GlobalCommandState.getInstance().addValue(CommandStateConstants.TEST_CLASS, testClass);
Command initCommand = getInitCommand();
initCommand.execute(commandState);
InteractiveTestCommand testCommand = new InteractiveTestCommand();
StopCheckerListener stopCheckerListener = new StopCheckerListener();
Integer maxInactiveSeconds = getMaxInactiveSeconds();
if (maxInactiveSeconds != null) {
stopCheckerListener.setMaxInactiveSeconds(maxInactiveSeconds);
stopCheckerListener.start();
testCommand.addTestListener(stopCheckerListener);
}
Map<String, String> aliasMap = getAliasMap();
testCommand.setAliasMap(aliasMap);
Map<String, Command> commandMap = getCommandMap();
commandMap.put("usage", new UsageCommand(commandMap, aliasMap));
testCommand.setCommandMap(commandMap);
System.out.println("--------------------");
while (true) {
commandState.capture(testCommand);
try {
testCommand.execute(commandState);
}
catch (TerminatedApplicationException e) {
break;
}
}