Search in sources :

Example 11 with ModelControllerClient

use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.

the class CertificateRolesLoginModuleTestCase method stopContainer.

@Test
@InSequence(3)
public void stopContainer() throws Exception {
    deployer.undeploy(APP_NAME);
    final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
    final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
    LOGGER.trace("*** reseting test configuration");
    AbstractCertificateLoginModuleTestCase.HTTPSConnectorSetup.INSTANCE.tearDown(managementClient, CONTAINER);
    SecurityDomainsSetup.INSTANCE.tearDown(managementClient, CONTAINER);
    LOGGER.trace("*** stopping container");
    containerController.stop(CONTAINER);
}
Also used : ModelControllerClient(org.jboss.as.controller.client.ModelControllerClient) ManagementClient(org.jboss.as.arquillian.container.ManagementClient) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 12 with ModelControllerClient

use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.

the class CertificateRolesLoginModuleTestCase method startAndSetupContainer.

@Test
@InSequence(-1)
public void startAndSetupContainer() throws Exception {
    LOGGER.trace("*** starting server");
    containerController.start(CONTAINER);
    ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
    ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
    LOGGER.trace("*** will configure server now");
    AbstractCertificateLoginModuleTestCase.HTTPSConnectorSetup.INSTANCE.setup(managementClient, CONTAINER);
    SecurityDomainsSetup.INSTANCE.setup(managementClient, CONTAINER);
    LOGGER.trace("*** reloading server");
    executeReloadAndWaitForCompletion(client, 100000);
    deployer.deploy(APP_NAME);
}
Also used : ModelControllerClient(org.jboss.as.controller.client.ModelControllerClient) ManagementClient(org.jboss.as.arquillian.container.ManagementClient) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 13 with ModelControllerClient

use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.

the class DatabaseCertLoginModuleTestCase method stopContainer.

@Test
@InSequence(3)
public void stopContainer() throws Exception {
    deployer.undeploy(APP_NAME);
    final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
    final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
    LOGGER.trace("*** reseting test configuration");
    AbstractCertificateLoginModuleTestCase.HTTPSConnectorSetup.INSTANCE.tearDown(managementClient, CONTAINER);
    SecurityDomainsSetup.INSTANCE.tearDown(managementClient, CONTAINER);
    DBSetup.INSTANCE.tearDown(managementClient, CONTAINER);
    DataSourcesSetup.INSTANCE.tearDown(managementClient, CONTAINER);
    LOGGER.trace("*** stopping container");
    containerController.stop(CONTAINER);
}
Also used : ModelControllerClient(org.jboss.as.controller.client.ModelControllerClient) ManagementClient(org.jboss.as.arquillian.container.ManagementClient) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 14 with ModelControllerClient

use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.

the class DatabaseCertLoginModuleTestCase method startAndSetupContainer.

@Test
@InSequence(-1)
public void startAndSetupContainer() throws Exception {
    LOGGER.trace("*** starting server");
    containerController.start(CONTAINER);
    ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
    ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
    LOGGER.trace("*** will configure server now");
    AbstractCertificateLoginModuleTestCase.HTTPSConnectorSetup.INSTANCE.setup(managementClient, CONTAINER);
    DataSourcesSetup.INSTANCE.setup(managementClient, CONTAINER);
    DBSetup.INSTANCE.setup(managementClient, CONTAINER);
    SecurityDomainsSetup.INSTANCE.setup(managementClient, CONTAINER);
    LOGGER.trace("*** reloading server");
    executeReloadAndWaitForCompletion(client, 100000);
    deployer.deploy(APP_NAME);
}
Also used : ModelControllerClient(org.jboss.as.controller.client.ModelControllerClient) ManagementClient(org.jboss.as.arquillian.container.ManagementClient) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 15 with ModelControllerClient

use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.

the class SSLEJBRemoteClientTestCase method prepareServerOnce.

@Before
public void prepareServerOnce() throws Exception {
    if (!serverConfigDone) {
        // prepare server config and then restart
        log.trace("*** preparing server configuration");
        ManagementClient managementClient;
        log.trace("*** starting server");
        container.start(DEFAULT_JBOSSAS);
        final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
        managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
        log.trace("*** will configure server now");
        SSLRealmSetupTool.setup(managementClient);
        log.trace("*** restarting server");
        container.stop(DEFAULT_JBOSSAS);
        container.start(DEFAULT_JBOSSAS);
        managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
        // write SSL realm config to output - debugging purposes
        SSLRealmSetupTool.readSSLRealmConfig(managementClient);
        serverConfigDone = true;
    } else {
        log.trace("*** Server already prepared, skipping config procedure");
    }
}
Also used : ManagementClient(org.jboss.as.arquillian.container.ManagementClient) ModelControllerClient(org.jboss.as.controller.client.ModelControllerClient) Before(org.junit.Before)

Aggregations

ModelControllerClient (org.jboss.as.controller.client.ModelControllerClient)58 ModelNode (org.jboss.dmr.ModelNode)27 Test (org.junit.Test)21 ManagementClient (org.jboss.as.arquillian.container.ManagementClient)17 IOException (java.io.IOException)11 InSequence (org.jboss.arquillian.junit.InSequence)8 URL (java.net.URL)5 PathAddress (org.jboss.as.controller.PathAddress)5 Before (org.junit.Before)5 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)4 UnknownHostException (java.net.UnknownHostException)3 InitialContext (javax.naming.InitialContext)2 NamingException (javax.naming.NamingException)2 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)2 CommandContext (org.jboss.as.cli.CommandContext)2 CommandFormatException (org.jboss.as.cli.CommandFormatException)2 OperationFormatException (org.jboss.as.cli.operation.OperationFormatException)2 DefaultOperationRequestBuilder (org.jboss.as.cli.operation.impl.DefaultOperationRequestBuilder)2 After (org.junit.After)2 BeforeClass (org.junit.BeforeClass)2