Search in sources :

Example 6 with DomainLifecycleUtil

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

the class DefaultConfigSmokeTestCase method testMasterAndSlave.

@Test
public void testMasterAndSlave() throws Exception {
    final WildFlyManagedConfiguration masterConfig = createConfiguration("domain.xml", "host-master.xml", getClass().getSimpleName());
    final DomainLifecycleUtil masterUtils = new DomainLifecycleUtil(masterConfig);
    final WildFlyManagedConfiguration slaveConfig = createConfiguration("domain.xml", "host-slave.xml", getClass().getSimpleName(), "slave", slaveAddress, 19999);
    final DomainLifecycleUtil slaveUtils = new DomainLifecycleUtil(slaveConfig);
    try {
        masterUtils.start();
        slaveUtils.start();
        // Double-check server status by confirming server-one can accept a web request to the root
        URLConnection connection = new URL("http://" + TestSuiteEnvironment.formatPossibleIpv6Address(slaveAddress) + ":8080").openConnection();
        connection.connect();
    } finally {
        try {
            slaveUtils.stop();
        } finally {
            masterUtils.stop();
        }
    }
}
Also used : WildFlyManagedConfiguration(org.jboss.as.test.integration.domain.management.util.WildFlyManagedConfiguration) DomainLifecycleUtil(org.jboss.as.test.integration.domain.management.util.DomainLifecycleUtil) URLConnection(java.net.URLConnection) URL(java.net.URL) Test(org.junit.Test)

Aggregations

DomainLifecycleUtil (org.jboss.as.test.integration.domain.management.util.DomainLifecycleUtil)6 WildFlyManagedConfiguration (org.jboss.as.test.integration.domain.management.util.WildFlyManagedConfiguration)4 Test (org.junit.Test)3 URL (java.net.URL)2 URLConnection (java.net.URLConnection)2 IOException (java.io.IOException)1 PathAddress (org.jboss.as.controller.PathAddress)1 MgmtOperationException (org.jboss.as.test.integration.management.util.MgmtOperationException)1 ModelNode (org.jboss.dmr.ModelNode)1 Property (org.jboss.dmr.Property)1 Before (org.junit.Before)1