use of org.glassfish.api.admin.CommandRunner in project Payara by payara.
the class CommandRunnerTest method tryOut.
@Test
public void tryOut() {
Assert.assertTrue(commandRunner != null);
try {
ActionReport report = commandRunner.getActionReport("plain");
CommandRunner.CommandInvocation inv = commandRunner.getCommandInvocation("list-contracts", report, kernelIdentity.getSubject());
inv.execute();
System.out.println(report.getTopMessagePart().getMessage());
for (ActionReport.MessagePart child : report.getTopMessagePart().getChildren()) {
System.out.println(child.getMessage());
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations