Search in sources :

Example 11 with MgmtOperationException

use of org.jboss.as.test.integration.management.util.MgmtOperationException in project wildfly by wildfly.

the class LegacyConfigTest method awaitServerLaunch.

private void awaitServerLaunch(ModelControllerClient client, String profile) throws InterruptedException {
    long timeout = System.currentTimeMillis() + TimeoutUtil.adjust(20000);
    ModelNode op = Util.getReadAttributeOperation(TEST_SERVER, "server-state");
    do {
        try {
            ModelNode state = DomainTestUtils.executeForResult(op, client);
            if ("running".equalsIgnoreCase(state.asString())) {
                return;
            }
        } catch (IOException | MgmtOperationException e) {
        // ignore and try again
        }
        TimeUnit.MILLISECONDS.sleep(250L);
    } while (System.currentTimeMillis() < timeout);
    Assert.fail("Server did not start using " + profile);
}
Also used : IOException(java.io.IOException) ModelNode(org.jboss.dmr.ModelNode) MgmtOperationException(org.jboss.as.test.integration.management.util.MgmtOperationException)

Aggregations

MgmtOperationException (org.jboss.as.test.integration.management.util.MgmtOperationException)11 ModelNode (org.jboss.dmr.ModelNode)11 IOException (java.io.IOException)4 Test (org.junit.Test)3 PathAddress (org.jboss.as.controller.PathAddress)1 PathElement (org.jboss.as.controller.PathElement)1 DomainClient (org.jboss.as.controller.client.helpers.domain.DomainClient)1 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)1