use of org.jboss.as.arquillian.container.ManagementClient 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);
}
use of org.jboss.as.arquillian.container.ManagementClient 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");
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class ClusterTestUtil method executeOnNodesAndReload.
// Model management convenience methods
public static void executeOnNodesAndReload(String cli, ManagementClient... clients) throws Exception {
ModelNode request = CLITestUtil.getCommandContext().buildRequest(cli);
for (ManagementClient client : clients) {
client.getControllerClient().execute(request);
ServerReload.executeReloadAndWaitForCompletion(client.getControllerClient(), ServerReload.TIMEOUT, false, client.getMgmtAddress(), client.getMgmtPort());
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class HTTPSWebConnectorTestCase method stopContainer.
@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.trace("*** reseting test configuration");
serverTearDown(managementClient);
LOGGER.trace("*** stopping container");
containerController.stop(CONTAINER);
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class WSAttributesChangesTestCase method performWsdlHostAttributeTest.
private void performWsdlHostAttributeTest(boolean checkUpdateWithDeployedEndpoint) 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 = getAttribute("wsdl-host", client);
final String hostnameA = "foo-host-a";
ModelNode op = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-host");
op.get(VALUE).set(hostnameA);
//update successful, no need to reload
applyUpdate(client, op, false);
//now we deploy an endpoint...
deployer.deploy(DEP_1);
//verify the updated wsdl host is used...
URL wsdlURL = new URL(managementClient.getWebUri().toURL(), '/' + DEP_1 + "/POJOService?wsdl");
checkWsdl(wsdlURL, hostnameA);
if (checkUpdateWithDeployedEndpoint) {
final String hostnameB = "foo-host-b";
ModelNode opB = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
opB.get(NAME).set("wsdl-host");
opB.get(VALUE).set(hostnameB);
//update again, but we'll need to reload, as there's an active deployment
applyUpdate(client, opB, true);
//check the wsdl host is still the one we updated to before
checkWsdl(wsdlURL, hostnameA);
//and check that still applies even if we undeploy and redeploy the endpoint
deployer.undeploy(DEP_1);
deployer.deploy(DEP_1);
checkWsdl(wsdlURL, hostnameA);
}
} finally {
try {
deployer.undeploy(DEP_1);
} catch (Throwable t) {
//ignore
}
try {
if (initialWsdlHost != null) {
ModelNode op = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-host");
op.get(VALUE).set(initialWsdlHost);
applyUpdate(client, op, checkUpdateWithDeployedEndpoint);
}
} finally {
managementClient.close();
}
}
}
Aggregations