use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class JsseTestCase method addEmpty.
@Test
public void addEmpty() throws Exception {
cli.sendLine("/subsystem=security/security-domain=empty-jsse/jsse=classic:add()");
CLIOpResult result = cli.readAllAsOpResult();
assertThat(result, is(notNullValue()));
assertThat(result.getFromResponse(OUTCOME).toString(), is("success"));
}
use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class JsseTestCase method addValid.
@Test
public void addValid() throws Exception {
cli.sendLine("/subsystem=security/security-domain=empty-jsse-valid/jsse=classic:add(server-alias=silent.planet)");
CLIOpResult result = cli.readAllAsOpResult();
assertThat(result, is(notNullValue()));
assertThat(result.getFromResponse(OUTCOME).toString(), is("success"));
}
use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class DataSourceTestCase method testModifyXaDataSource.
private void testModifyXaDataSource() throws Exception {
StringBuilder cmd = new StringBuilder("xa-data-source --profile=" + profileNames[0] + " --name=java:jboss/datasources/TestXADS");
for (String[] props : DS_PROPS) {
cmd.append(" --");
cmd.append(props[0]);
cmd.append("=");
cmd.append(props[1]);
}
cli.sendLine(cmd.toString());
// check that datasource was modified
cli.sendLine("/profile=" + profileNames[0] + "/subsystem=datasources/xa-data-source=java\\:jboss\\/datasources\\/TestXADS:read-resource(recursive=true)");
CLIOpResult result = cli.readAllAsOpResult();
assertTrue(result.isIsOutcomeSuccess());
assertTrue(result.getResult() instanceof Map);
Map dsProps = (Map) result.getResult();
for (String[] props : DS_PROPS) assertTrue(dsProps.get(props[0]).equals(props[1]));
}
use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class RolloutPlanTestCase method after.
@AfterClass
public static void after() throws Exception {
if (warFile.exists()) {
//noinspection ResultOfMethodCallIgnored
warFile.delete();
}
// stop test-one
cli.sendLine("/host=master/server-config=test-one:stop(blocking=true)");
CLIOpResult res = cli.readAllAsOpResult();
Assert.assertTrue(res.isIsOutcomeSuccess());
waitUntilState("test-one", "STOPPED");
// stop main-two
cli.sendLine("/host=master/server-config=main-two:stop(blocking=true)");
res = cli.readAllAsOpResult();
Assert.assertTrue(res.isIsOutcomeSuccess());
waitUntilState("main-two", "DISABLED");
AbstractCliTestBase.closeCLI();
CLITestSuite.stopSupport();
}
use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class RolloutPlanTestCase method testRollbackAcrossGroupsRolloutPlan.
/**
* Tests rollout plan with RollbackAcrossGroups set to true.
*/
@Test
public void testRollbackAcrossGroupsRolloutPlan() throws Exception {
// deploy helper servlets
cli.sendLine("deploy " + warFile.getAbsolutePath() + " --all-server-groups");
checkURL("main-one", false, "/RolloutPlanTestCase/RolloutServlet");
checkURL("main-two", false, "/RolloutPlanTestCase/RolloutServlet");
checkURL("main-three", false, "/RolloutPlanTestCase/RolloutServlet");
checkURL("test-one", false, "/RolloutPlanTestCase/RolloutServlet");
// prepare socket binding
cli.sendLine("/socket-binding-group=standard-sockets/socket-binding=test-binding:add(interface=public,port=" + TEST_PORT + ")");
// create plan with max fail server set to 1
RolloutPlanBuilder planBuilder = new RolloutPlanBuilder();
planBuilder.addGroup(serverGroups[0], new RolloutPlanBuilder.RolloutPolicy(true, null, 1));
planBuilder.addGroup(serverGroups[1], new RolloutPlanBuilder.RolloutPolicy(true, null, 1));
planBuilder.addGroup(serverGroups[2], new RolloutPlanBuilder.RolloutPolicy(true, null, 1));
planBuilder.setRollBackAcrossGroups(true);
String rolloutPlan = planBuilder.buildAsString();
cli.sendLine("rollout-plan add --name=groupsRollbackPlan --content=" + rolloutPlan);
// let the main-one ane main-three fail, main two rollback and then test-one rollback
// let the helper server bind to test port to prevent successful subsequent add connector operation on main-one
checkURL("main-one", false, "/RolloutPlanTestCase/RolloutServlet?operation=bind&bindPort=" + TEST_PORT);
checkURL("main-three", false, "/RolloutPlanTestCase/RolloutServlet?operation=bind&bindPort=" + String.valueOf(TEST_PORT + CLITestSuite.portOffsets.get("main-three")));
CLIOpResult ret = testAddConnector("groupsRollbackPlan");
Assert.assertFalse(ret.isIsOutcomeSuccess());
Assert.assertFalse(getServerStatus("main-one", ret));
Assert.assertFalse(getServerStatus("main-two", ret));
Assert.assertFalse(getServerStatus("main-three", ret));
Assert.assertFalse(getServerStatus("test-one", ret));
// remove rollout plan
cli.sendLine("rollout-plan remove --name=groupsRollbackPlan");
}
Aggregations