Propagate exception / test failures so that the correct status code is returned.

Fixes gh-2048 and fixes gh-2051
This commit is contained in:
Graeme Rocher
2014-12-02 16:50:47 +01:00
committed by Dave Syer
parent 1611e631db
commit dbcbebca4a
5 changed files with 83 additions and 11 deletions

View File

@@ -78,8 +78,12 @@ public class CliTester implements TestRule {
public String test(String... args) throws Exception {
Future<TestCommand> future = submitCommand(new TestCommand(), args);
this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS));
return getOutput();
try {
this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS));
return getOutput();
} catch (Exception e) {
return getOutput();
}
}
public String grab(String... args) throws Exception {