Package org.rhq.core.clientapi.descriptor.plugin

Examples of org.rhq.core.clientapi.descriptor.plugin.PluginDescriptor


    @BeforeTest
    protected void before() throws Exception {

        InputStream is = getClass().getResourceAsStream("/META-INF/rhq-plugin.xml");
        PluginDescriptor pd = AgentPluginDescriptorUtil.parsePluginDescriptor(is);
        PluginMetadataManager pmm = new PluginMetadataManager();
        pmm.addTestPlatformType();
        Set<ResourceType> rts = pmm.loadPlugin(pd);
        ResourceType resourceType = rts.iterator().next();
        configuration = resourceType.getPluginConfigurationDefinition().getDefaultTemplate().createConfiguration();
View Full Code Here


            }
        });
        for (URL url : l) {
            log.debug("parse " + url);
            InputStream is = url.openStream();
            PluginDescriptor pd = AgentPluginDescriptorUtil.parsePluginDescriptor(is);
            processPluginDescriptor(pd);
            log.debug("pmm names " + pmm.getPluginNames());
            buildDesc(pd.getServers());
            buildDesc(pd.getServices());
            is.close();
        }
    }
View Full Code Here

            }
        });
        for (URL url : l) {
            log.debug("parse " + url);
            InputStream is = url.openStream();
            PluginDescriptor pd = AgentPluginDescriptorUtil.parsePluginDescriptor(is);
            processPluginDescriptor(pd);
            log.debug("pmm names " + pmm.getPluginNames());
            buildDesc(pd.getServers());
            buildDesc(pd.getServices());
            is.close();
        }
    }
View Full Code Here

     */
    @BeforeTest
    protected void before() throws Exception {

        InputStream is = getClass().getResourceAsStream("/META-INF/rhq-plugin.xml");
        PluginDescriptor pd = AgentPluginDescriptorUtil.parsePluginDescriptor(is);
        ResourceType platformType = pmm.addTestPlatformType();
        Set<ResourceType> rts = pmm.loadPlugin(pd);
        for (ResourceType resourceType : pmm.loadPlugin(pd)) {
            String componentType = pmm.getComponentClass(resourceType);
            ResourceComponent component = (ResourceComponent) Class.forName(componentType).newInstance();
View Full Code Here

     }

     @Test
     public void testParseViaMetaDataManager() throws Exception {

         PluginDescriptor pluginDescriptor;

         URL descriptorUrl = this.getClass().getClassLoader().getResource(DESCRIPTOR_FILENAME);
         System.out.println("Loading plugin descriptor at: " + descriptorUrl);

         pluginDescriptor = AgentPluginDescriptorUtil.parsePluginDescriptor(descriptorUrl
View Full Code Here

            throw new RuntimeException(t);
        }
    }

    public void loadPluginDescriptors() throws Exception {
        PluginDescriptor descriptor = loadPluginDescriptor(DESCRIPTOR);
        outputAllTypes();
        assertTypes();

        PluginDependencyGraph graph = new PluginDependencyGraph();
        AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor);
View Full Code Here

        topPlatform1.getChildResourceTypes().contains(topService);
        topPlatform2.getChildResourceTypes().contains(topService);
    }

    private PluginDescriptor loadPluginDescriptor(String file) throws Exception {
        PluginDescriptor pluginDescriptor;

        URL descriptorUrl = this.getClass().getClassLoader().getResource(file);
        System.out.println("Loading plugin descriptor at: " + descriptorUrl);

        JAXBContext jaxbContext = JAXBContext.newInstance(DescriptorPackages.PC_PLUGIN);
View Full Code Here

public class PluginTransformerTest {

    @Test
    public void pluginNameShouldBeSetToDescriptorName() throws Exception {
        PluginDescriptor pluginDescriptor = new PluginDescriptor();
        pluginDescriptor.setName("testPlugin");

        PluginTransformer transformer = new PluginTransformer();

        Plugin plugin = transformer.toPlugin(pluginDescriptor, getTestPluginURL());

        assertEquals(
            plugin.getName(),
            pluginDescriptor.getName(),
            "The plugin.name property should be set to the plugin descriptor name."
        );
    }
View Full Code Here

        );
    }

    @Test
    public void pluginDisplayNameShouldBeSetToDescriptorDisplayName() throws Exception {
        PluginDescriptor pluginDescriptor = new PluginDescriptor();
        pluginDescriptor.setName("testPlugin");
        pluginDescriptor.setDisplayName("Test Plugin");

        PluginTransformer transformer = new PluginTransformer();

        Plugin plugin = transformer.toPlugin(pluginDescriptor, getTestPluginURL());

        assertEquals(
            plugin.getDisplayName(),
            pluginDescriptor.getDisplayName(),
            "The plugin.displayName property should be set to the plugin descriptor display name."
        );
    }
View Full Code Here

        );
    }

    @Test
    public void pluginDisplayNameShouldBeSetToDescriptorNameWhenItsDisplayNameIsNull() throws Exception {
        PluginDescriptor pluginDescriptor = new PluginDescriptor();
        pluginDescriptor.setName("testPlugin");

        PluginTransformer transformer = new PluginTransformer();

        Plugin plugin = transformer.toPlugin(pluginDescriptor, getTestPluginURL());

        assertEquals(
            plugin.getDisplayName(),
            pluginDescriptor.getName(),
            "The plugin.displayName property should be set to the plugin descriptor name when the descriptor display name is null."
        );
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.descriptor.plugin.PluginDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.