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

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


        File jarFile = createPluginJARFileWithoutVersionInManifest();
        URL pluginURL = toURL(jarFile);

        PluginTransformer transformer = new PluginTransformer();

        Plugin plugin = transformer.toPlugin(new PluginDescriptor(), pluginURL);
    }
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

        assert topService_service1.getParentResourceTypes().size() == 1;
        assert topService_service1.getParentResourceTypes().iterator().next().equals(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

        }
    }

    @Test
    public void loadPluginDescriptorTest1() throws Exception {
        PluginDescriptor pluginDescriptor;

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

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

        outputTypes();
    }

    @Test(dependsOnMethods = "loadPluginDescriptorTest1")
    public void loadPluginDescriptorTest2() throws Exception {
        PluginDescriptor pluginDescriptor;

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

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

        outputTypes();
    }

    @Test(dependsOnMethods = "loadPluginDescriptorTest2")
    public void loadPluginDescriptorTest3() throws Exception {
        PluginDescriptor pluginDescriptor;

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

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

        }
    }

    @Test
    public void loadPluginDescriptorTest1() throws Exception {
        PluginDescriptor pluginDescriptor;

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

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

        assertServerTypeIsOK(serverAType);
    }

    @Test(dependsOnMethods = "loadPluginDescriptorTest1")
    public void loadPluginDescriptorTest2() throws Exception {
        PluginDescriptor pluginDescriptor;

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

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

        assertServerTypeIsOK(serverBType);
    }

    @Test(dependsOnMethods = "loadPluginDescriptorTest2")
    public void loadPluginDescriptorTest3() throws Exception {
        PluginDescriptor pluginDescriptor;

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

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

            throw new RuntimeException(t);
        }
    }

    public void loadPluginDescriptors() throws Exception {
        PluginDescriptor descriptor_jmx = loadPluginDescriptor(DESCRIPTOR_JMX);
        assertJmxTypes();

        PluginDescriptor descriptor_tomcat = loadPluginDescriptor(DESCRIPTOR_TOMCAT);
        assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).isEmpty(); // jbossas not yet registered
        assertTomcatTypes();

        PluginDescriptor descriptor_jbossas = loadPluginDescriptor(DESCRIPTOR_JBOSSAS);
        assertJBossASTypes();

        PluginDescriptor descriptor_hibernate = loadPluginDescriptor(DESCRIPTOR_HIBERNATE);
        assertHibernateTypes();

        PluginDescriptor descriptor_customjmx = loadPluginDescriptor(DESCRIPTOR_CUSTOMJMX);
        assertCustomJmxTypes();

        outputAllTypes();

        PluginDependencyGraph graph = new PluginDependencyGraph();
        AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_jmx);
        AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_tomcat);
        AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_jbossas);
        AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_hibernate);
        AgentPluginDescriptorUtil.addPluginToDependencyGraph(graph, descriptor_customjmx);
        assert graph.isComplete(null);

        // these are not extended via embedded extension model
        assert this.metadataManager.getEmbeddedExtensions(descriptor_jmx.getName()).isEmpty();
        assert this.metadataManager.getEmbeddedExtensions(descriptor_jbossas.getName()).isEmpty();
        assert this.metadataManager.getEmbeddedExtensions(descriptor_hibernate.getName()).isEmpty();
        assert this.metadataManager.getEmbeddedExtensions(descriptor_customjmx.getName()).isEmpty();
        // tomcat plugin is extended by the jbossas plugin via the embedded extension model
        assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).size() == 1;
        assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).containsKey(
            descriptor_jbossas.getName());

        // deploy another plugin that extends the tomcat plugin so we can see multiple extensions returned
        PluginDescriptor descriptor_customext = loadPluginDescriptor(DESCRIPTOR_CUSTOM_EXT);
        assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).size() == 2;
        assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).containsKey(
            descriptor_jbossas.getName());
        assert this.metadataManager.getEmbeddedExtensions(descriptor_tomcat.getName()).containsKey(
            descriptor_customext.getName());
    }
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.