Skip to content

Commit

Permalink
[WFCORE-3642]: Cleaning the domain after the test
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsavoie committed Feb 23, 2018
1 parent 315d463 commit a76a9b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -54,3 +54,4 @@ testsuite-core/standalone/cli_output

# Zanata files
**/.zanata-cache/
/testsuite/domain/target1/
Expand Up @@ -32,9 +32,9 @@
import org.jboss.as.test.integration.domain.management.util.WildFlyManagedConfiguration;
import org.jboss.as.test.shared.TimeoutUtil;
import org.jboss.dmr.ModelNode;
import org.junit.AfterClass;
import org.junit.After;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.Test;

/**
Expand All @@ -43,15 +43,15 @@
*/
public class ReadOnlyModeTestCase {

private static DomainTestSupport.Configuration domainConfig;
private static DomainTestSupport domainManager;
private static DomainLifecycleUtil domainMasterLifecycleUtil;
private static DomainLifecycleUtil domainSlaveLifecycleUtil;
private DomainTestSupport.Configuration domainConfig;
private DomainTestSupport domainManager;
private DomainLifecycleUtil domainMasterLifecycleUtil;
private DomainLifecycleUtil domainSlaveLifecycleUtil;
private static final long TIMEOUT_S = TimeoutUtil.adjust(30);
private static final int TIMEOUT_SLEEP_MILLIS = 50;

@BeforeClass
public static void setupDomain() throws Exception {
@Before
public void setupDomain() throws Exception {
domainConfig = DomainTestSupport.Configuration.create(ReadOnlyModeTestCase.class.getSimpleName(),
"domain-configs/domain-standard.xml", "host-configs/host-master.xml", "host-configs/host-slave.xml");
domainConfig.getMasterConfiguration().setReadOnlyHost(true);
Expand All @@ -64,8 +64,8 @@ public static void setupDomain() throws Exception {
domainSlaveLifecycleUtil = domainManager.getDomainSlaveLifecycleUtil();
}

@AfterClass
public static void tearDownDomain() throws Exception {
@After
public void tearDownDomain() throws Exception {
domainManager.stop();
domainManager = null;
domainMasterLifecycleUtil = null;
Expand Down Expand Up @@ -120,8 +120,10 @@ public void testConfigurationNotUpdated() throws Exception {
domainManager.stop();
domainConfig.getMasterConfiguration().setRewriteConfigFiles(false);
domainConfig.getSlaveConfiguration().setRewriteConfigFiles(false);
domainManager.getDomainMasterLifecycleUtil().startAsync();
domainManager.getDomainSlaveLifecycleUtil().startAsync();
domainMasterLifecycleUtil = domainManager.getDomainMasterLifecycleUtil();
domainSlaveLifecycleUtil = domainManager.getDomainSlaveLifecycleUtil();
domainMasterLifecycleUtil.startAsync();
domainSlaveLifecycleUtil.startAsync();
try (final DomainClient clientMaster = getDomainClient(domainConfig.getMasterConfiguration())) {
waitForHostControllerBeingStarted(TIMEOUT_S, clientMaster);
Assert.assertTrue(Operations.getFailureDescription(clientMaster.execute(Operations.createReadAttributeOperation(domainAddress, "value"))).asString().contains("WFLYCTL0216"));
Expand Down

0 comments on commit a76a9b9

Please sign in to comment.