Skip to content

Commit 49109e8

Browse files
committed
Merge pull request wildfly#8329 from ctomc/testsuite-optimize
WFLY-5571 remove ModelPersistenceTestCase from full
2 parents b077f3a + 5f7cf23 commit 49109e8

File tree

2 files changed

+26
-288
lines changed

2 files changed

+26
-288
lines changed

testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/management/api/ManagementOnlyModeTestCase.java

+26-30
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,36 @@
2121
*/
2222
package org.jboss.as.test.integration.management.api;
2323

24+
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
25+
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADMIN_ONLY;
26+
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME;
27+
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
28+
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
29+
import static org.jboss.as.test.integration.management.util.ModelUtil.createOpNode;
30+
2431
import java.net.URL;
2532
import java.util.concurrent.Callable;
33+
2634
import org.jboss.arquillian.container.test.api.Deployment;
2735
import org.jboss.arquillian.container.test.api.RunAsClient;
2836
import org.jboss.arquillian.junit.Arquillian;
2937
import org.jboss.arquillian.test.api.ArquillianResource;
38+
import org.jboss.as.test.integration.management.base.ContainerResourceMgmtTestBase;
39+
import org.jboss.as.test.integration.management.util.WebUtil;
40+
import org.jboss.as.test.shared.RetryTaskExecutor;
3041
import org.jboss.dmr.ModelNode;
3142
import org.jboss.shrinkwrap.api.Archive;
3243
import org.jboss.shrinkwrap.api.ShrinkWrap;
3344
import org.jboss.shrinkwrap.api.spec.JavaArchive;
45+
import org.junit.Assert;
3446
import org.junit.Test;
3547
import org.junit.runner.RunWith;
36-
import org.junit.Assert;
37-
import static org.jboss.as.test.integration.management.util.ModelUtil.createOpNode;
38-
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
39-
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADMIN_ONLY;
40-
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
41-
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
42-
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME;
43-
44-
import org.jboss.as.test.integration.management.base.ContainerResourceMgmtTestBase;
45-
import org.jboss.as.test.integration.management.util.WebUtil;
46-
import org.jboss.as.test.shared.RetryTaskExecutor;
47-
import org.junit.Ignore;
4848

4949
/**
50-
*
5150
* @author Dominik Pospisil <[email protected]>
5251
*/
5352
@RunWith(Arquillian.class)
5453
@RunAsClient
55-
@Ignore("ARQ-791")
5654
public class ManagementOnlyModeTestCase extends ContainerResourceMgmtTestBase {
5755

5856
@ArquillianResource
@@ -75,20 +73,20 @@ public void testManagementOnlyMode() throws Exception {
7573
ModelNode result = executeOperation(op);
7674

7775
// wait until the server is admin-only mode
78-
RetryTaskExecutor rte = new RetryTaskExecutor();
76+
RetryTaskExecutor<ModelNode> rte = new RetryTaskExecutor<>();
7977
rte.retryTask(new Callable<ModelNode>() {
8078

8179
public ModelNode call() throws Exception {
8280
ModelNode rop = createOpNode(null, READ_ATTRIBUTE_OPERATION);
8381
rop.get(NAME).set("running-mode");
8482
ModelNode mode = executeOperation(rop);
85-
if (! mode.asString().equals("ADMIN_ONLY")) throw new Exception ("Wrong mode.");
83+
if (!mode.asString().equals("ADMIN_ONLY")) { throw new Exception("Wrong mode."); }
8684
return mode;
8785
}
8886
});
8987

9088
// check that the server is unreachable
91-
Assert.assertFalse("Could not connect to created connector.",WebUtil.testHttpURL(new URL(
89+
Assert.assertFalse("Could not connect to created connector.", WebUtil.testHttpURL(new URL(
9290
"http", url.getHost(), url.getPort(), "/").toString()));
9391

9492
// update the model in admin-only mode - add a web connector
@@ -97,7 +95,7 @@ public ModelNode call() throws Exception {
9795
op.get("port").set(TEST_PORT);
9896
result = executeOperation(op);
9997

100-
op = createOpNode("subsystem=undertow/listener=test", ADD);
98+
op = createOpNode("subsystem=undertow/server=default-server/http-listener=test", ADD);
10199
op.get("socket-binding").set("test-binding");
102100
result = executeOperation(op);
103101

@@ -107,28 +105,26 @@ public ModelNode call() throws Exception {
107105
result = executeOperation(op);
108106

109107
// wait until the server is in normal mode
110-
rte = new RetryTaskExecutor();
111-
rte.retryTask(new Callable<ModelNode>() {
112-
public ModelNode call() throws Exception {
113-
ModelNode rop = createOpNode(null, READ_ATTRIBUTE_OPERATION);
114-
rop.get(NAME).set("running-mode");
115-
ModelNode mode = executeOperation(rop);
116-
if (! mode.asString().equals("NORMAL")) throw new Exception ("Wrong mode.");
117-
return mode;
118-
}
108+
rte = new RetryTaskExecutor<>();
109+
rte.retryTask(() -> {
110+
ModelNode rop = createOpNode(null, READ_ATTRIBUTE_OPERATION);
111+
rop.get(NAME).set("running-mode");
112+
ModelNode mode = executeOperation(rop);
113+
if (!mode.asString().equals("NORMAL")) { throw new Exception("Wrong mode."); }
114+
return mode;
119115
});
120116

121117

122118
// check that the server is up
123-
Assert.assertTrue("Could not connect to created connector.",WebUtil.testHttpURL(new URL(
119+
Assert.assertTrue("Could not connect to created connector.", WebUtil.testHttpURL(new URL(
124120
"http", url.getHost(), url.getPort(), "/").toString()));
125121

126122
// check that the changes made in admin-only mode have been applied - test the connector
127-
Assert.assertTrue("Could not connect to created connector.",WebUtil.testHttpURL(new URL(
123+
Assert.assertTrue("Could not connect to created connector.", WebUtil.testHttpURL(new URL(
128124
"http", url.getHost(), TEST_PORT, "/").toString()));
129125

130126
// remove the conector
131-
op = createOpNode("subsystem=undertow/listener=test", REMOVE);
127+
op = createOpNode("subsystem=undertow/server=default-server/http-listener=test", REMOVE);
132128
result = executeOperation(op);
133129
op = createOpNode("socket-binding-group=standard-sockets/socket-binding=test-binding", REMOVE);
134130
result = executeOperation(op);

testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/management/api/ModelPersistenceTestCase.java

-258
This file was deleted.

0 commit comments

Comments
 (0)