Package org.jboss.as.arquillian.container

Examples of org.jboss.as.arquillian.container.ManagementClient


   
    @Test
    @OperateOnDeployment(DEPLOYMENT)
    public void testWSDLHostUndefineRequiresReloadAndDoesNotAffectRuntime() throws Exception {
        Assert.assertTrue(containerController.isStarted(DEFAULT_JBOSSAS));
        ManagementClient managementClient = new ManagementClient(TestSuiteEnvironment.getModelControllerClient(),
                TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
       
        ModelControllerClient client = managementClient.getControllerClient();
        String initialWsdlHost = null;
        try {
            initialWsdlHost = getWsdlHost(client);
           
            //change wsdl-host to "my-host" and reload
            final String hostname = "my-host";
          setWsdlHost(client, hostname);
          reloadServer(client, 100000);

            //undefine wsdl-host and verify deployment still uses "foo-host"
          setWsdlHost(client, null);
          URL wsdlURL = new URL(managementClient.getWebUri().toURL(), '/' + DEPLOYMENT + "/POJOService?wsdl");
          checkWsdl(wsdlURL, hostname);
        } finally {
            try {
                if (initialWsdlHost != null) {
                    setWsdlHost(client, initialWsdlHost);
                }
            } finally {
                managementClient.close();
            }
        }
    }
View Full Code Here


    @Before
    public void initializeRoleConfiguration() throws Exception {
        if (containerController.isStarted(CONTAINER) && !serverConfigured) {
            final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
            ManagementClient mgmtClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(),
                    TestSuiteEnvironment.getServerPort(), "http-remoting");
            prepareServer(mgmtClient);
        }
    }
View Full Code Here

    @After
    public void restoreRoleConfiguration() throws Exception {
        if (serverConfigured && containerController.isStarted(CONTAINER)) {
            final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
            ManagementClient mgmtClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(),
                    TestSuiteEnvironment.getServerPort(), "http-remoting");
            cleanUpServer(mgmtClient);
        }
    }
View Full Code Here

    public void startAndSetupContainer() throws Exception {

        LOGGER.info("*** starting server");
        containerController.start(CONTAINER);
        ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
        ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(),
                TestSuiteEnvironment.getServerPort(), "http-remoting");

        LOGGER.info("*** will configure server now");
        serverSetup(managementClient);

View Full Code Here

    @Test
    @InSequence(3)
    public void stopContainer() throws Exception {
        deployer.undeploy(APP_CONTEXT);
        final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
        final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(),
                TestSuiteEnvironment.getServerPort(), "http-remoting");
        LOGGER.info("*** reseting test configuration");
        serverTearDown(managementClient);

        LOGGER.info("*** stopping container");
View Full Code Here

    @Before
    public void startContainer() throws Exception {
        // Start the server
        container.start(CONTAINER);
        final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
        final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
        try {
            logFile = getAbsoluteLogFilePath(client);

            // Create the custom handler
            ModelNode op = Operations.createAddOperation(CUSTOM_HANDLER_ADDRESS);
            op.get("class").set("org.apache.log4j.FileAppender");
            op.get("module").set("org.apache.log4j");
            ModelNode opProperties = op.get("properties").setEmptyObject();
            opProperties.get("file").set(logFile.getAbsolutePath());
            opProperties.get("immediateFlush").set(true);
            client.execute(op);

            // Add the handler to the root-logger
            op = Operations.createOperation("add-handler", ROOT_LOGGER_ADDRESS);
            op.get(ModelDescriptionConstants.NAME).set(CUSTOM_HANDLER_NAME);
            client.execute(op);

            // Stop the container
            container.stop(CONTAINER);
            // Start the server again
            container.start(CONTAINER);

            Assert.assertTrue("Container is not started", managementClient.isServerInRunningState());

            // Deploy the servlet
            deployer.deploy(DEPLOYMENT);
        } finally {
            safeClose(managementClient);
View Full Code Here

        LOGGER.info("*** starting server");
        container.start(CONTAINER);

        final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
        managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(),
                TestSuiteEnvironment.getServerPort(), "http-remoting");

        serverSetup.setup(managementClient, CONTAINER);

        LOGGER.info("Add system property: " + TESTING_SYSTEM_PROPERTY);
View Full Code Here

    }

    @Before
    public void prepareContainer() throws Exception {
        final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
        final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
        try {
            // Start the container
            container.start(CONTAINER);

            // Get custom log files
View Full Code Here

    }

    @Test
    public void disablePerDeployLogging(@ArquillianResource URL url) throws Exception {
        final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
        final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
        Assert.assertTrue("Container is not started", managementClient.isServerInRunningState());

        try {
            // Per-deploy logging test
            Response response = getResponse(new URL(url, "logger?msg=" + URLEncoder.encode(DEPLOYMENT_LOG_MESSAGE, "utf-8")));
            Assert.assertTrue("Invalid response statusCode: " + response + " URL: " + url, response.statusCode == HttpServletResponse.SC_OK);
View Full Code Here

    @Before
    public void startContainer() throws Exception {
        // Start the server
        container.start(CONTAINER);
        final ManagementClient managementClient = createManagementClient();
        final ModelControllerClient client = managementClient.getControllerClient();
        try {
            Assert.assertTrue("Container is not started", managementClient.isServerInRunningState());

            // Deploy the servlet
            deployer.deploy(DEPLOYMENT);
        } finally {
            safeClose(managementClient);
View Full Code Here

TOP

Related Classes of org.jboss.as.arquillian.container.ManagementClient

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.