use of org.jboss.as.test.integration.domain.management.util.DomainLifecycleUtil in project wildfly by wildfly.
the class DefaultConfigSmokeTestCase method testStandardHost.
@Test
public void testStandardHost() throws Exception {
final WildFlyManagedConfiguration config = createConfiguration("domain.xml", "host.xml", getClass().getSimpleName());
final DomainLifecycleUtil utils = new DomainLifecycleUtil(config);
try {
utils.start();
// Double-check server status by confirming server-one can accept a web request to the root
URLConnection connection = new URL("http://" + TestSuiteEnvironment.formatPossibleIpv6Address(masterAddress) + ":8080").openConnection();
connection.connect();
if (Boolean.getBoolean("expression.audit")) {
writeExpressionAudit(utils);
}
} finally {
// Stop
utils.stop();
}
}
use of org.jboss.as.test.integration.domain.management.util.DomainLifecycleUtil in project wildfly by wildfly.
the class ExpressionSupportSmokeTestCase method setUp.
@Before
public void setUp() throws IOException {
final WildFlyManagedConfiguration config = createConfiguration("domain.xml", "host.xml", getClass().getSimpleName());
config.setAdminOnly(true);
// Trigger the servers to fail on boot if there are runtime errors
String hostProps = config.getHostCommandLineProperties();
hostProps = hostProps == null ? "" : hostProps;
config.setHostCommandLineProperties(hostProps + "\n-Djboss.unsupported.fail-boot-on-runtime-failure=true");
domainMasterLifecycleUtil = new DomainLifecycleUtil(config);
// domainMasterLifecycleUtil.getConfiguration().addHostCommandLineProperty("-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=y");
// Start
domainMasterLifecycleUtil.start();
conflicts = noSimple = noSimpleCollection = noComplexList = noComplexProperty = noObject = noComplexProperty = supportedUndefined = simple = simpleCollection = object = complexProperty = complexList = 0;
}
use of org.jboss.as.test.integration.domain.management.util.DomainLifecycleUtil in project wildfly by wildfly.
the class MixedDomainTestSupport method startAndAdjust.
private void startAndAdjust() {
String jbossDomainServerArgsValue = null;
try {
if (version.isEAP6Version()) {
jbossDomainServerArgsValue = System.getProperty(JBOSS_DOMAIN_SERVER_ARGS);
if (jbossDomainServerArgsValue != null) {
System.setProperty(JBOSS_DOMAIN_SERVER_ARGS, "-DnotUsed");
}
}
//Start the master in admin only and reconfigure the domain with what
//we want to test in the mixed domain and have the DomainAdjuster
//strip down the domain model to something more workable. The domain
//adjusters will also make adjustments for the legacy version being
//tested.
DomainLifecycleUtil masterUtil = getDomainMasterLifecycleUtil();
masterUtil.getConfiguration().setAdminOnly(true);
//masterUtil.getConfiguration().addHostCommandLineProperty("-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=y");
masterUtil.start();
if (legacyConfig) {
LegacyConfigAdjuster.adjustForVersion(masterUtil.getDomainClient(), version);
} else {
DomainAdjuster.adjustForVersion(masterUtil.getDomainClient(), version);
}
//Now reload the master in normal mode
masterUtil.executeAwaitConnectionClosed(Util.createEmptyOperation("reload", PathAddress.pathAddress(HOST, "master")));
masterUtil.connect();
masterUtil.awaitHostController(System.currentTimeMillis());
//Start the slaves
DomainLifecycleUtil slaveUtil = getDomainSlaveLifecycleUtil();
if (slaveUtil != null) {
//slaveUtil.getConfiguration().addHostCommandLineProperty("-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=y");
slaveUtil.start();
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
if (version.isEAP6Version() && jbossDomainServerArgsValue != null) {
System.setProperty(JBOSS_DOMAIN_SERVER_ARGS, jbossDomainServerArgsValue);
}
}
}
use of org.jboss.as.test.integration.domain.management.util.DomainLifecycleUtil in project wildfly by wildfly.
the class DomainHostExcludesTest method startSlave.
private static void startSlave() throws TimeoutException, InterruptedException {
DomainLifecycleUtil legacyUtil = testSupport.getDomainSlaveLifecycleUtil();
long start = System.currentTimeMillis();
legacyUtil.start();
legacyUtil.awaitServers(start);
}
use of org.jboss.as.test.integration.domain.management.util.DomainLifecycleUtil in project wildfly by wildfly.
the class OrderedChildResourcesTestCase method testOrderedChildResources.
@Test
public void testOrderedChildResources() 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();
PathAddress jgroupsTcpAddr = PathAddress.pathAddress(PROFILE, "full-ha").append(SUBSYSTEM, "jgroups").append("stack", "tcp");
final ModelNode originalMasterStack = readResource(masterUtils.getDomainClient(), jgroupsTcpAddr);
originalMasterStack.protect();
final ModelNode originalSlaveStack = readResource(slaveUtils.getDomainClient(), jgroupsTcpAddr);
originalSlaveStack.protect();
Assert.assertEquals(originalMasterStack, originalSlaveStack);
//FD is normally in the middle somewhere
final String protocolName = "FD";
int index = -1;
ModelNode value = null;
Iterator<Property> it = originalMasterStack.get(PROTOCOL).asPropertyList().iterator();
for (int i = 0; it.hasNext(); i++) {
Property property = it.next();
if (property.getName().equals(protocolName)) {
value = property.getValue();
index = i;
break;
}
}
//Make sure that we found the protocol and that it is not at the end
Assert.assertTrue(0 <= index);
Assert.assertTrue(index < originalMasterStack.get(PROTOCOL).keys().size() - 2);
//Remove the protocol
DomainTestUtils.executeForResult(Util.createRemoveOperation(jgroupsTcpAddr.append(PROTOCOL, protocolName)), masterUtils.getDomainClient());
//Reload the master into admin-only and re-add the protocol
reloadMaster(masterUtils, true);
ModelNode add = value.clone();
add.get(OP).set(ADD);
add.get(OP_ADDR).set(jgroupsTcpAddr.append(PROTOCOL, protocolName).toModelNode());
add.get(ADD_INDEX).set(index);
DomainTestUtils.executeForResult(add, masterUtils.getDomainClient());
//Reload the master into normal mode and check the protocol is in the right place on the slave
reloadMaster(masterUtils, false);
ModelNode slaveStack = readResource(slaveUtils.getDomainClient(), jgroupsTcpAddr);
Assert.assertEquals(originalMasterStack, slaveStack);
//Check that :read-operation-description has add-index defined; WFLY-6782
ModelNode rodOp = Util.createOperation(READ_OPERATION_DESCRIPTION_OPERATION, jgroupsTcpAddr.append(PROTOCOL, protocolName));
rodOp.get(NAME).set(ADD);
ModelNode result = DomainTestUtils.executeForResult(rodOp, masterUtils.getDomainClient());
Assert.assertTrue(result.get(REQUEST_PROPERTIES).hasDefined(ADD_INDEX));
} finally {
try {
slaveUtils.stop();
} finally {
masterUtils.stop();
}
}
}
Aggregations