use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class PermissionsCoverageTestCase method testTheEntireDomainTreeHasPermissionsDefined.
@Test
public void testTheEntireDomainTreeHasPermissionsDefined() throws Exception {
ModelControllerClient client = managementClient.getControllerClient();
assertTheEntireDomainTreeHasPermissionsDefined(client);
}
use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class LayeredDistributionTestCase method testLayeredProductVersion.
@Test
public void testLayeredProductVersion() throws Throwable {
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
ModelNode readAttrOp = new ModelNode();
readAttrOp.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION);
readAttrOp.get(ModelDescriptionConstants.NAME).set("product-name");
ModelNode result = ManagementOperations.executeOperation(client, readAttrOp);
Assert.assertEquals(result.asString(), PRODUCT_NAME);
readAttrOp.get(ModelDescriptionConstants.NAME).set("product-version");
result = ManagementOperations.executeOperation(client, readAttrOp);
Assert.assertEquals(result.asString(), PRODUCT_VERSION);
}
use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class OutboundLdapConnectionTestCase method restoreRoleConfiguration.
@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);
}
}
use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class SSLEJBRemoteClientTestCase method tearDown.
@AfterClass
public static void tearDown() throws Exception {
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
final ManagementClient mClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
SSLRealmSetupTool.tearDown(mClient, container);
}
use of org.jboss.as.controller.client.ModelControllerClient in project wildfly by wildfly.
the class FailoverTestCase method testBackupFailoverAfterFailback.
@Test
public void testBackupFailoverAfterFailback() throws Exception {
ModelControllerClient client2 = createClient2();
JMSOperations backupJMSOperations = JMSOperationsProvider.getInstance(client2);
checkJMSQueue(backupJMSOperations, jmsQueueName, false);
InitialContext context1 = createJNDIContextFromServer1();
String text = "sent to server1, received from server2 (after failover)";
sendMessage(context1, jmsQueueLookup, text);
context1.close();
log.trace("############## 1 #############");
//listSharedStoreDir();
log.trace("===================");
log.trace("STOP SERVER1...");
log.trace("===================");
container.stop(SERVER1);
log.trace("############## 2 #############");
//listSharedStoreDir();
// let some time for the backup to detect the failure
waitForHornetQServerActivation(backupJMSOperations, true);
checkJMSQueue(backupJMSOperations, jmsQueueName, true);
InitialContext context2 = createJNDIContextFromServer2();
// receive the message that was sent to server1 before failover occurs
receiveMessage(context2, jmsQueueLookup, text);
// send a message to server2 before server1 fails back
String text2 = "sent to server2, received from server 1 (after failback)";
sendMessage(context2, jmsQueueLookup, text2);
context2.close();
log.trace("====================");
log.trace("START SERVER1...");
log.trace("====================");
// restart the live server
container.start(SERVER1);
// let some time for the backup to detect the live node and failback
ModelControllerClient client1 = createClient1();
JMSOperations liveJMSOperations = JMSOperationsProvider.getInstance(client1);
waitForHornetQServerActivation(liveJMSOperations, true);
checkHornetQServerStartedAndActiveAttributes(liveJMSOperations, true, true);
// let some time for the backup to detect the failure
waitForHornetQServerActivation(backupJMSOperations, false);
// backup server has been restarted in passive mode
checkHornetQServerStartedAndActiveAttributes(backupJMSOperations, true, false);
checkJMSQueue(backupJMSOperations, jmsQueueName, false);
context1 = createJNDIContextFromServer1();
// receive the message that was sent to server2 before failback
receiveMessage(context1, jmsQueueLookup, text2);
String text3 = "sent to server1, received from server2 (after 2nd failover)";
// send a message to server1 before it is stopped a 2nd time
sendMessage(context1, jmsQueueLookup, text3);
context1.close();
log.trace("==============================");
log.trace("STOP SERVER1 A 2ND TIME...");
log.trace("==============================");
// shutdown server1 a 2nd time
container.stop(SERVER1);
// let some time for the backup to detect the failure
waitForHornetQServerActivation(backupJMSOperations, true);
checkHornetQServerStartedAndActiveAttributes(backupJMSOperations, true, true);
checkJMSQueue(backupJMSOperations, jmsQueueName, true);
context2 = createJNDIContextFromServer2();
// receive the message that was sent to server1 before failover occurs a 2nd time
receiveMessage(context2, jmsQueueLookup, text3);
context2.close();
//Assert.fail("wth");
}
Aggregations