use of org.jboss.as.cli.CommandContext in project eap-additional-testsuite by jboss-set.
the class NonExistingPathComparisonTestCase method testNotEqual.
@Test
public void testNotEqual() throws Exception {
final CommandContext ctx = CLITestUtil.getCommandContext(cliOut);
try {
ctx.connectController();
ctx.handle(this.getAddPropertyReq("\"false\""));
assertEquals("false", runIf(ctx, "!=", "&&", "\"true\""));
assertEquals("true", runIf(ctx, "!=", "||", "\"true\""));
} finally {
ctx.handleSafe(this.getRemovePropertyReq());
ctx.terminateSession();
cliOut.reset();
}
}
use of org.jboss.as.cli.CommandContext in project eap-additional-testsuite by jboss-set.
the class NonExistingPathComparisonTestCase method testNotGreaterThan.
@Test
public void testNotGreaterThan() throws Exception {
final CommandContext ctx = CLITestUtil.getCommandContext(cliOut);
try {
ctx.connectController();
ctx.handle(this.getAddPropertyReq("\"5\""));
assertEquals("5", runIf(ctx, "<=", "&&", "\"5\""));
assertEquals("true", runIf(ctx, "<=", "||", "\"5\""));
} finally {
ctx.handleSafe(this.getRemovePropertyReq());
ctx.terminateSession();
cliOut.reset();
}
}
use of org.jboss.as.cli.CommandContext in project eap-additional-testsuite by jboss-set.
the class TryCatchFinallyTestCase method testTryFinally.
@Test
public void testTryFinally() throws Exception {
cliOut.reset();
final CommandContext ctx = CLITestUtil.getCommandContext(cliOut);
try {
ctx.connectController();
ctx.handle("try");
ctx.handle(this.getAddPropertyReq("try"));
ctx.handle("finally");
ctx.handle(this.getWritePropertyReq("finally"));
ctx.handle("end-try");
cliOut.reset();
ctx.handle(getReadPropertyReq());
assertEquals("finally", getValue());
} finally {
ctx.handleSafe(getRemovePropertyReq());
ctx.terminateSession();
cliOut.reset();
}
}
use of org.jboss.as.cli.CommandContext in project eap-additional-testsuite by jboss-set.
the class TryCatchFinallyTestCase method testSuccessfulTry.
@Test
public void testSuccessfulTry() throws Exception {
cliOut.reset();
final CommandContext ctx = CLITestUtil.getCommandContext(cliOut);
try {
ctx.connectController();
ctx.handle("try");
ctx.handle(getAddPropertyReq("try"));
ctx.handle("catch");
ctx.handle(getRemovePropertyReq());
ctx.handle("end-try");
cliOut.reset();
ctx.handle(getReadPropertyReq());
assertEquals("try", getValue());
} finally {
ctx.handleSafe(getRemovePropertyReq());
ctx.terminateSession();
cliOut.reset();
}
}
use of org.jboss.as.cli.CommandContext in project eap-additional-testsuite by jboss-set.
the class BasicIfElseTestCase method testMain.
@Test
public void testMain() throws Exception {
final CommandContext ctx = CLITestUtil.getCommandContext(cliOut);
try {
ctx.connectController();
ctx.handle(this.getAddPropertyReq("\"true\""));
assertEquals("false", runIf(ctx));
assertEquals("true", runIf(ctx));
assertEquals("false", runIf(ctx));
} finally {
ctx.handleSafe(this.getRemovePropertyReq());
ctx.terminateSession();
cliOut.reset();
}
}
Aggregations