use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class CredentialStoreTestCase method testUnmodifiableInternally.
private void testUnmodifiableInternally(final String csName) throws IOException, Exception {
try (CLIWrapper cli = new CLIWrapper(true)) {
assertContainsAliases(cli, csName, ALIAS_PASSWORD, ALIAS_SECRET);
cli.sendLine(String.format("/subsystem=elytron/credential-store=%s/alias=%1$s:add(secret-value=%1$s)", csName), true);
final CLIOpResult opResult = cli.readAllAsOpResult();
assertFalse("Adding alias to non-modifiable credential store should fail.", opResult.isIsOutcomeSuccess());
}
assertCredentialValue(csName, ALIAS_PASSWORD, "password");
assertCredentialValue(csName, ALIAS_SECRET, "secret");
assertCredentialNotFound(csName, csName);
}
use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class RolloutPlanTestCase method testCleanupConnector.
private void testCleanupConnector(String rolloutPlanId) throws Exception {
CLIOpResult ret = testRemoveConnector(rolloutPlanId);
Assert.assertTrue(ret.isIsOutcomeSuccess());
Assert.assertTrue(getServerStatus("test-one", ret));
boolean gotNoResponse = false;
for (String server : new String[] { "main-one", "main-two", "main-three" }) {
try {
Assert.assertFalse(getServerStatus(server, ret));
} catch (NoResponseException e) {
if (gotNoResponse) {
throw e;
}
gotNoResponse = true;
}
}
Assert.assertTrue("received no response from one server", gotNoResponse);
}
use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class WildCardReadsTestCase method testLenientReadOperationDescription.
/**
* Tests WFLY-2527 added behavior of supporting read-operation-description for
* wildcard addresses where there is no generic resource registration for the type
*/
@Test
public void testLenientReadOperationDescription() throws IOException {
cli.sendLine(String.format(OP_PATTERN, EVICTION, ModelDescriptionConstants.READ_OPERATION_NAMES_OPERATION));
CLIOpResult opResult = cli.readAllAsOpResult();
Assert.assertTrue(opResult.isIsOutcomeSuccess());
for (ModelNode node : opResult.getResponseNode().get(ModelDescriptionConstants.RESULT).asList()) {
String opPart = String.format(READ_OP_DESC_OP, node.asString());
cli.sendLine(String.format(OP_PATTERN, EVICTION, opPart));
opResult = cli.readAllAsOpResult();
Assert.assertTrue(opResult.isIsOutcomeSuccess());
ModelNode specific = opResult.getResponseNode().get(ModelDescriptionConstants.RESULT);
cli.sendLine(String.format(OP_PATTERN, "*", opPart));
opResult = cli.readAllAsOpResult();
Assert.assertTrue(opResult.isIsOutcomeSuccess());
Assert.assertEquals("mismatch for " + node.asString(), specific, opResult.getResponseNode().get(ModelDescriptionConstants.RESULT));
}
}
use of org.jboss.as.test.integration.management.util.CLIOpResult in project wildfly by wildfly.
the class DataSourceTestCase method testModifyDataSource.
private void testModifyDataSource() throws Exception {
StringBuilder cmd = new StringBuilder("data-source --name=TestDS");
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("/subsystem=datasources/data-source=TestDS:read-resource(recursive=true)");
CLIOpResult result = cli.readAllAsOpResult();
assertTrue(result.getResult().toString(), 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 JsseTestCase method addMissingPassword.
@Test
public void addMissingPassword() throws IOException {
cli.sendLine("/subsystem=security/security-domain=empty-jsse-missing-pwd/jsse=classic:add(server-alias=silent.planet,keystore={type=JKS})", true);
CLIOpResult result = cli.readAllAsOpResult();
assertThat(result, is(notNullValue()));
assertThat(result.getFromResponse(OUTCOME).toString(), is("failed"));
}
Aggregations