Allow tests to System.exit() by default
Otherwise the ApplicationContext stays alive and if it's a server app the JVM does not exit at the end of "spring test". User can override with "spring test foo.groovy --nohup" (which we have to do in our unit tests).
This commit is contained in:
@@ -75,7 +75,10 @@ public class CliTester implements TestRule {
|
||||
}
|
||||
|
||||
public String test(String... args) throws Exception {
|
||||
Future<TestCommand> future = submitCommand(new TestCommand(), args);
|
||||
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);
|
||||
this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS));
|
||||
return getOutput();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user