Add ExitStatus to Command.run()
The main difference for now is the removal of the --nohup (slightly hacky) option in TestCommand. Now a TestCommand can signal to its caller that it wants to be hung up. Fixes gh-975
This commit is contained in:
@@ -28,8 +28,9 @@ public class CustomCommand extends AbstractCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
public ExitStatus run(String... args) throws Exception {
|
||||
System.err.println("Custom Command Hello");
|
||||
return ExitStatus.OK;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,10 +75,7 @@ public class CliTester implements TestRule {
|
||||
}
|
||||
|
||||
public String test(String... args) throws Exception {
|
||||
String[] argsToUse = new String[args.length + 1];
|
||||
System.arraycopy(args, 0, argsToUse, 1, args.length);
|
||||
argsToUse[0] = "--nohup";
|
||||
Future<TestCommand> future = submitCommand(new TestCommand(), argsToUse);
|
||||
Future<TestCommand> future = submitCommand(new TestCommand(), args);
|
||||
this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS));
|
||||
return getOutput();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user