Clear JAVA_OPTS in CLI tests; avoid permsize config error with Java 8

When a Java 8 JVM is launched with -XX:MaxPermSize a warning message
is output indicating that the option will be ignored. This causes the
CLI tests that assert that no error output has been produced to fail.

This commit updates the CLI's integration test harness to remove
JAVA_OPTS from the environment of the CLI process. This prevents any
unwanted max perm size configuration from leaking into that
environment and breaking the build.
This commit is contained in:
Andy Wilkinson
2015-05-11 11:12:22 +01:00
parent ca94bd4b94
commit 2053f4b2bf

View File

@@ -57,7 +57,10 @@ public final class CommandLineInvoker {
List<String> command = new ArrayList<String>();
command.add(findLaunchScript().getAbsolutePath());
command.addAll(Arrays.asList(args));
return new ProcessBuilder(command).directory(this.workingDirectory).start();
ProcessBuilder processBuilder = new ProcessBuilder(command)
.directory(this.workingDirectory);
processBuilder.environment().remove("JAVA_OPTS");
return processBuilder.start();
}
private File findLaunchScript() {