Examples of RhqAgentPluginArchive


Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

        } catch (Exception e) {
            throw new DeploymentException("Failed to switch to PluginContainer [" + container.get().getName() + "].",
                    e);
        }

        RhqAgentPluginArchive pluginArchive = archive.as(RhqAgentPluginArchive.class);

        Node descriptor = pluginArchive.get(ArchivePaths.create("META-INF/rhq-plugin.xml"));
        if (descriptor == null) {
            throw new DeploymentException("Plugin archive [" + archive + "] doesn't specify an RHQ plugin descriptor.");
        }

        boolean wasStarted = stopPc();

        deployPlugin(pluginArchive);

        if (wasStarted) {
            startPc();
        }

        PluginContainer pc = PluginContainer.getInstance();
        String pluginName = getPluginName(pluginArchive);
        PluginEnvironment plugin = pc.getPluginManager().getPlugin(pluginName);
        if (plugin == null) {
            throw new RuntimeException("Failed to deploy plugin '" + pluginName + "' (" + pluginArchive.getName()
                    + ") - check the log above for an error (and big stack trace) from PluginManager.initialize().");
        }

        LOG.info("Done deploying plugin '" + pluginName + "' (" + archive + ") to PluginContainer "
                + container.get().getName() +".");
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

            switchPcInstance();
        } catch (Exception e) {
            throw new DeploymentException("Failed to switch plugin container.", e);
        }

        RhqAgentPluginArchive plugin = archive.as(RhqAgentPluginArchive.class);

        boolean wasStarted = stopPc();

        File pluginDeploymentPath = getDeploymentPath(plugin);

        if (pluginDeploymentPath.exists() && !pluginDeploymentPath.delete()) {
            if (File.separatorChar == '/') {
                // Unix
                throw new DeploymentException("Could not delete the RHQ plugin jar " + plugin.getName());
            } else {
                // Windows
                // TODO: file locking, probably due to
                // http://management-platform.blogspot.com/2009/01/classloaders-keeping-jar-files-open.html,
                // is not allowing deletion. Perhaps this can be fixed at some point.               
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

    }

    private void deployPlugin(RhqAgentPluginArchive plugin) {
        if (plugin.getRequiredPlugins() != null) {
            for (Archive<?> a : plugin.getRequiredPlugins()) {
                RhqAgentPluginArchive p = a.as(RhqAgentPluginArchive.class);
                deployPlugin(p);
            }
        }

        File pluginDeploymentPath = getDeploymentPath(plugin);
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

public class ReadOnlyScheduleSetTest extends Arquillian {

    @Deployment(name = "TwoMetricPlugin")
    @TargetsContainer("connected-pc-with-metric-collection")
    public static RhqAgentPluginArchive getTestPlugin() {
        RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "bz821058-plugin-1.0.jar");
        HashMap<String, String> replacements = new HashMap<String, String>();
        replacements.put("@@@discovery@@@", SingleResourceDiscoveryComponent.class.getName());
        replacements.put("@@@class@@@", BZ821058ResourceComponent.class.getName());
        replacements.put("@@@metric1.interval@@@", "30000");
        replacements.put("@@@metric2.interval@@@", "30000");
        return pluginJar.setPluginDescriptorFromTemplate("two-metric-rhq-plugin.xml", replacements).addClasses(
            SingleResourceDiscoveryComponent.class, BZ821058ResourceComponent.class);
    }
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

public class LateMeasurementRescheduleTest extends Arquillian {

    @Deployment(name = "TwoMetricPlugin")
    @TargetsContainer("connected-pc-with-metric-collection")
    public static RhqAgentPluginArchive getTestPlugin() {
        RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "bz834019-plugin-1.0.jar");
        HashMap<String, String> replacements = new HashMap<String, String>();
        replacements.put("@@@discovery@@@", SingleResourceDiscoveryComponent.class.getName());
        replacements.put("@@@class@@@", BZ834019ResourceComponent.class.getName());
        replacements.put("@@@metric1.interval@@@", "30000");
        replacements.put("@@@metric2.interval@@@", "35000"); // this MUST be 35s - if you make it 30s, the collections won't be late!
        return pluginJar.setPluginDescriptorFromTemplate("two-metric-rhq-plugin.xml", replacements).addClasses(
            SingleResourceDiscoveryComponent.class, BZ834019ResourceComponent.class);
    }
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

public class AvailTest extends Arquillian {

    @Deployment(name = "availPlugin")
    @TargetsContainer("connected-pc")
    public static RhqAgentPluginArchive getTestPlugin() {
        RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "avail-plugin-1.0.jar");
        return pluginJar
                .setPluginDescriptor("avail-rhq-plugin.xml")
                .addClasses(AvailDiscoveryComponent.class, AvailResourceComponent.class);
    }
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

public class DiscoveryCallbackTest extends Arquillian {

    @Deployment(name = "test")
    @TargetsContainer("pc")
    public static RhqAgentPluginArchive getTestOnePlugin() {
        RhqAgentPluginArchive pluginJar1 = ShrinkWrap.create(RhqAgentPluginArchive.class, "test-discovery-callback1-plugin.jar");
        RhqAgentPluginArchive pluginJar2 = ShrinkWrap.create(RhqAgentPluginArchive.class, "test-discovery-callback2-plugin.jar");
        pluginJar1.setPluginDescriptor("discovery-callback1.xml").addClasses(
            TestResourceDiscoveryComponent.class, TestResourceComponent.class, PluginOneCallback.class);
        pluginJar2.setPluginDescriptor("discovery-callback2.xml").addClasses(
                TestResourceDiscoveryComponent.class, TestResourceComponent.class, PluginTwoCallback1.class, PluginTwoCallback2.class);
        pluginJar2.withRequiredPluginsFrom(pluginJar1);
        return pluginJar2;
    }
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

    private Set<TestComponent> components;
   
    @Deployment
    @TargetsContainer("native-enabled-pc")
    public static RhqAgentPluginArchive getTestPlugin() {
        RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "test-plugin.jar");
        return pluginJar
            .setPluginDescriptor("getnativeprocess-rhq-plugin.xml")
            .addClasses(TestDiscoveryComponent.class, TestComponent.class);
    }
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

public class InventoryManagerTest extends Arquillian {

    @Deployment(name = "test")
    @TargetsContainer("pc")
    public static RhqAgentPluginArchive getTestPlugin() {
        RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "test-plugin.jar");
        return pluginJar
                .setPluginDescriptor("test-rhq-plugin.xml")
                .addClasses(TestResourceDiscoveryComponent.class, TestResourceComponent.class);
    }
View Full Code Here

Examples of org.rhq.test.shrinkwrap.RhqAgentPluginArchive

public class DiscoveryTest extends Arquillian {

    @Deployment(name = "test")
    @TargetsContainer("pc")
    public static RhqAgentPluginArchive getTestPlugin() {
        RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "test-plugin.jar");
        return pluginJar.setPluginDescriptor("test-great-grandchild-discovery-plugin.xml").addClasses(
            TestResourceDiscoveryComponent.class, TestResourceComponent.class, ManualAddDiscoveryComponent.class);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.