use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class ClusteredMessagingTestCase method tearDown.
@After
public void tearDown() throws Exception {
try (ModelControllerClient client = createClient1()) {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
jmsOperations.removeJmsQueue(jmsQueueName);
jmsOperations.removeJmsTopic(jmsTopicName);
}
try (ModelControllerClient client = createClient2()) {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
jmsOperations.removeJmsQueue(jmsQueueName);
jmsOperations.removeJmsTopic(jmsTopicName);
}
container.stop(CONTAINER_0);
container.stop(CONTAINER_1);
}
use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class ModClusterSubsystemAddTestCase method testModClusterAdd.
@Test
@InSequence(1)
public void testModClusterAdd() throws Exception {
final CommandContext ctx = CLITestUtil.getCommandContext();
final ModelControllerClient controllerClient = managementClient.getControllerClient();
try {
ctx.connectController();
// Add the mod_cluster extension first (not in this profile by default)
ModelNode request = ctx.buildRequest("/extension=org.jboss.as.modcluster:add");
ModelNode response = controllerClient.execute(request);
String outcome = response.get("outcome").asString();
Assert.assertEquals("Adding mod_cluster extension failed! " + request.toJSONString(false), "success", outcome);
// Now lets execute subsystem add operation but we need to specify a connector
ctx.getBatchManager().activateNewBatch();
Batch b = ctx.getBatchManager().getActiveBatch();
b.add(ctx.toBatchedCommand("/socket-binding-group=standard-sockets/socket-binding=modcluster:add(multicast-port=23364, multicast-address=224.0.1.105)"));
b.add(ctx.toBatchedCommand("/subsystem=modcluster:add"));
b.add(ctx.toBatchedCommand("/subsystem=modcluster/mod-cluster-config=configuration:add(connector=http,advertise-socket=modcluster)"));
request = b.toRequest();
b.clear();
ctx.getBatchManager().discardActiveBatch();
response = controllerClient.execute(request);
outcome = response.get("outcome").asString();
Assert.assertEquals("Adding mod_cluster subsystem failed! " + request.toJSONString(false), "success", outcome);
} finally {
ctx.terminateSession();
}
}
use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class ModClusterSubsystemAddTestCase method testModClusterRemove.
@Test
@InSequence(2)
public void testModClusterRemove() throws Exception {
final CommandContext ctx = CLITestUtil.getCommandContext();
final ModelControllerClient controllerClient = managementClient.getControllerClient();
try {
ctx.connectController();
// Test subsystem remove
ModelNode request = ctx.buildRequest("/subsystem=modcluster:remove");
ModelNode response = controllerClient.execute(request);
String outcome = response.get("outcome").asString();
Assert.assertEquals("Removing mod_cluster subsystem failed! " + request.toJSONString(false), "success", outcome);
// Cleanup socket binding
request = ctx.buildRequest("/socket-binding-group=standard-sockets/socket-binding=modcluster:remove");
response = controllerClient.execute(request);
outcome = response.get("outcome").asString();
Assert.assertEquals("Removing socket binding failed! " + request.toJSONString(false), "success", outcome);
// Cleanup and remove the extension
request = ctx.buildRequest("/extension=org.jboss.as.modcluster:remove");
response = controllerClient.execute(request);
outcome = response.get("outcome").asString();
Assert.assertEquals("Removing mod_cluster extension failed! " + request.toJSONString(false), "success", outcome);
} finally {
ctx.terminateSession();
}
}
use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class StatelessBean method getJBossProperty.
public String getJBossProperty(String name) {
ModelControllerClient client = getClient();
String result = Utils.getProperty(name, client);
log.debug("JBoss system property " + name + " was resolved to be " + result);
return result;
}
use of org.jboss.as.controller.client.ModelControllerClient 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);
}
Aggregations