Package org.rhq.modules.plugins.jbossas7.helper

Examples of org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration$Property


        return null;
    }

    private File findLogFile() {
        File logFile = null;
        ServerPluginConfiguration serverPluginConfig = getServerComponent().getServerPluginConfiguration();
        File logDir = serverPluginConfig.getLogDir();
        if ((BaseComponent<?>) getServerComponent() instanceof HostControllerComponent) {
            logDir = findLogDirForManagedDeployment();
        }
        if (logDir != null && logDir.isDirectory()) {
            try {
View Full Code Here


    @Test
    public void shouldFindResponseTimeFilterLogInStandaloneServer() throws Exception {
        when(parentResourceComponent.getPath()).thenReturn(PARENT_COMPONENT_PATH_IN_STANDALONE_SERVER);
        when(parentResourceComponent.getServerComponent()).thenReturn(standaloneASComponent);
        when(standaloneASComponent.isManuallyAddedServer()).thenReturn(Boolean.FALSE);
        ServerPluginConfiguration standaloneServerPluginConfig = createStandaloneServerPluginConfig();
        when(standaloneASComponent.getServerPluginConfiguration()).thenReturn(standaloneServerPluginConfig);
        File standaloneResponseTimeLogFile = createStandaloneServerResponseTimeLogFile(standaloneServerPluginConfig);

        Set<DiscoveredResourceDetails> details = discoveryComponent.discoverResources(discoveryContext);
        assertNotNull(details);
View Full Code Here

        assertNotNull(rtFilePath);
        assertEquals(rtFilePath, standaloneResponseTimeLogFile.getAbsolutePath());
    }

    private ServerPluginConfiguration createStandaloneServerPluginConfig() throws Exception {
        ServerPluginConfiguration mock = mock(ServerPluginConfiguration.class);
        when(mock.getLogDir()).thenReturn(createTempDir());
        return mock;
    }
View Full Code Here

    @Test
    public void shouldFindResponseTimeFilterLogInManagedServer() throws Exception {
        when(parentResourceComponent.getPath()).thenReturn(PARENT_COMPONENT_PATH_IN_MANAGED_SERVER);
        when(parentResourceComponent.getServerComponent()).thenReturn(hostControllerComponent);
        when(hostControllerComponent.isManuallyAddedServer()).thenReturn(Boolean.FALSE);
        ServerPluginConfiguration hostControllerServerPluginConfig = createHostControllerServerPluginConfig();
        when(hostControllerComponent.getServerPluginConfiguration()).thenReturn(hostControllerServerPluginConfig);
        File managedServerResponseTimeLogFile = createManagedServerResponseTimeLogFile(hostControllerServerPluginConfig);

        Set<DiscoveredResourceDetails> details = discoveryComponent.discoverResources(discoveryContext);
        assertNotNull(details);
View Full Code Here

        assertNotNull(rtFilePath);
        assertEquals(rtFilePath, managedServerResponseTimeLogFile.getAbsolutePath());
    }

    private ServerPluginConfiguration createHostControllerServerPluginConfig() throws Exception {
        ServerPluginConfiguration mock = mock(ServerPluginConfiguration.class);
        when(mock.getBaseDir()).thenReturn(createTempDir());
        return mock;
    }
View Full Code Here

    public void testServerAttributeValidation() throws Exception {
        AvailabilityType avail = getAvailability(getServerResource());
        assertEquals(avail, AvailabilityType.UP);

        Configuration pluginConfig = getServerResource().getPluginConfiguration();
        ServerPluginConfiguration serverPluginConfig = new ServerPluginConfiguration(pluginConfig);

        // Change the baseDir prop.
        File originalBaseDir = serverPluginConfig.getBaseDir();
        serverPluginConfig.setBaseDir(new File(System.getProperty("java.io.tmpdir")));

        // Restart the server ResourceComponent so it picks up the changes we just made to the plugin config.
        InventoryManager inventoryManager = this.pluginContainer.getInventoryManager();
        inventoryManager.deactivateResource(getServerResource());
        ResourceContainer serverContainer = inventoryManager.getResourceContainer(getServerResource());
        InvalidPluginConfigurationException ipce = null;
        try {
            inventoryManager.activateResource(getServerResource(), serverContainer, true);
        } catch (InvalidPluginConfigurationException e) {
            ipce = e;
        }

        // Set the baseDir back to the original value and restart the component before making any assertions, to ensure
        // things aren't left in a corrupt state for remaining test methods.
        serverPluginConfig.setBaseDir(originalBaseDir);
        inventoryManager.activateResource(getServerResource(), serverContainer, true);

        Assert.assertNotNull(ipce, "InvalidPluginConfigurationException was not thrown by server component's "
            + "start() method due to invalid baseDir.");
View Full Code Here

            return wrt.toString();
        }
    }

    private static File getMetadataRoot(Configuration referencedConfiguration) {
        ServerPluginConfiguration config = new ServerPluginConfiguration(referencedConfiguration);

        File installationDir = new File(config.getHomeDir(), ".installation");

        return new File(installationDir, ".rhq");
    }
View Full Code Here

        }

        BundleDeployResult result = new BundleDeployResult();

        ASConnection connection = new ASConnection(
            ASConnectionParams.createFrom(new ServerPluginConfiguration(request.getReferencedConfiguration())));

        ProcessExecutionResults results;
        BundleManagerProvider bmp = request.getBundleManagerProvider();
        BundleResourceDeployment rd = request.getResourceDeployment();
View Full Code Here

                pidsToRollback.add(pd.getId());
            }
        }

        ASConnection connection = new ASConnection(
            ASConnectionParams.createFrom(new ServerPluginConfiguration(request.getReferencedConfiguration())));

        String errorMessage = rollbackPatches(control, request.getBundleManagerProvider(),
            request.getLiveResourceDeployment(), connection, "purge", new ArrayList<String>(pidsToRollback));

        if (errorMessage != null) {
View Full Code Here

            return result;
        }

        ASConnection connection = new ASConnection(
            ASConnectionParams.createFrom(new ServerPluginConfiguration(request.getReferencedConfiguration())));

        ServerControl control = onServer(request);

        String errorMessage = rollbackPatches(control, request.getBundleManagerProvider(),
            request.getResourceDeployment(), connection, "revert", new ArrayList<String>(pidsToRollback));
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.helper.ServerPluginConfiguration$Property

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.