use of org.jboss.as.cli.impl.CommandContextImpl in project wildfly-core by wildfly.
the class BatchTestCase method testRollbackBatchBoot.
@Test
public void testRollbackBatchBoot() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
CommandContext ctx = new CommandContextImpl(out);
ctx.bindClient(managementClient.getControllerClient());
try {
doTestRollbackBatch(ctx, () -> {
String str = out.toString();
out.reset();
return str;
});
} finally {
ctx.terminateSession();
}
}
use of org.jboss.as.cli.impl.CommandContextImpl in project wildfly-core by wildfly.
the class HelpSupportTestCase method testCLICommands.
@Test
public void testCLICommands() throws Exception {
CommandContextImpl ctx = (CommandContextImpl) CommandContextFactory.getInstance().newCommandContext();
AeshCommands commands = ctx.getAeshCommands();
for (String name : commands.getRegistry().getAllCommandNames()) {
CLICommandContainer container = (CLICommandContainer) commands.getRegistry().getCommand(name, name);
if (!(container.getWrappedContainer() instanceof LegacyCommandContainer) && !isAeshExtension(container.getParser().getCommand())) {
HelpSupport.checkCommand(null, container.getParser());
for (CommandLineParser<CLICommandInvocation> child : container.getParser().getAllChildParsers()) {
HelpSupport.checkCommand(container.getParser(), child);
}
}
}
}
use of org.jboss.as.cli.impl.CommandContextImpl in project wildfly-core by wildfly.
the class CliSpecialCharactersTestCase method testSingleQuotesBoot.
@Test
public void testSingleQuotesBoot() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
CommandContext ctx = new CommandContextImpl(out);
ctx.bindClient(managementClient.getControllerClient());
Supplier<String> str = () -> {
String s = out.toString();
out.reset();
return s;
};
testSetResourceValue("It's", "It's", Delimiters.DOUBLE_QUOTE, ctx, str);
testSetResourceValue("It\\'s", "It's", Delimiters.NONE, ctx, str);
testSetResourceValue("''It's''", "''It's''", Delimiters.DOUBLE_QUOTE, ctx, str);
}
use of org.jboss.as.cli.impl.CommandContextImpl in project wildfly-core by wildfly.
the class CliSpecialCharactersTestCase method testWhitespaceInMiddleBoot.
/**
* Tests whitespace in the middle of words Regression test for
* https://issues.jboss.org/browse/JBEAP-4536
*
* @throws Exception
*/
@Test
public void testWhitespaceInMiddleBoot() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
CommandContext ctx = new CommandContextImpl(out);
ctx.bindClient(managementClient.getControllerClient());
Supplier<String> str = () -> {
String s = out.toString();
out.reset();
return s;
};
testSetResourceValue("Hello World!", "Hello World!", Delimiters.DOUBLE_QUOTE, ctx, str);
testSetResourceValue("Hello World!", "Hello World!", Delimiters.CURLY_BRACE, ctx, str);
testSetResourceValue("Hello\\ World!", "Hello World!", Delimiters.NONE, ctx, str);
}
use of org.jboss.as.cli.impl.CommandContextImpl in project wildfly-core by wildfly.
the class CliSpecialCharactersTestCase method testBracesBoot.
@Test
public void testBracesBoot() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
CommandContext ctx = new CommandContextImpl(out);
ctx.bindClient(managementClient.getControllerClient());
Supplier<String> str = () -> {
String s = out.toString();
out.reset();
return s;
};
testSetResourceValue("{braces}", "{braces}", Delimiters.DOUBLE_QUOTE, ctx, str);
}
Aggregations