--- old/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java 2015-06-16 23:14:28.926721280 +0300 +++ new/test/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java 2015-06-16 23:14:28.782721279 +0300 @@ -29,6 +29,7 @@ import java.util.List; import jdk.test.lib.DynamicVMOption; import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Platform; import jdk.test.lib.ProcessTools; import jdk.test.lib.dcmd.CommandExecutor; import jdk.test.lib.dcmd.JMXExecutor; @@ -43,6 +44,8 @@ * Executor for JCMD */ private final static CommandExecutor executor = new JMXExecutor(); + + private final static boolean isClient = Platform.isClient(); /** * Name of the tested parameter @@ -77,8 +80,10 @@ JVMOption parameter; switch (type) { + case "int": case "intx": case "size_t": + case "uint": case "uintx": case "uint64_t": parameter = new IntJVMOption(name, type); @@ -87,8 +92,9 @@ parameter = new DoubleJVMOption(name); break; default: - throw new Error("Expected only \"intx\", \"size_t\", \"uintx\", \"uint64_t\"," - + " or \"double\" option types! Got " + type + " type!"); + throw new Error("Expected only \"int\", \"intx\", \"size_t\", " + + "\"uint\", \"uintx\", \"uint64_t\", or \"double\" " + + "option types! Got " + type + " type!"); } return parameter; @@ -331,32 +337,36 @@ * @throws Exception if java process can not be started */ private boolean runJavaWithParam(String optionValue, boolean valid) throws Exception { - int returnCode; + int exitCode; boolean result = true; String value = optionValue.substring(optionValue.lastIndexOf("=") + 1); String fullOptionString = prependString.toString() + optionValue; List runJava = new ArrayList<>(); OutputAnalyzer out; + if (isClient) { + runJava.add("-client"); + } + runJava.addAll(prepend); runJava.add(optionValue); runJava.add(JVMOptionsUtils.class.getName()); + + out = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(runJava.toArray(new String[0])).start()); - out = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(true, runJava.toArray(new String[0])).start()); - - returnCode = out.getExitValue(); + exitCode = out.getExitValue(); if (out.getOutput().contains("A fatal error has been detected by the Java Runtime Environment")) { /* Always consider "fatal error" in output as fail */ - failedMessage(name, fullOptionString, valid, "JVM output reports a fatal error. JVM exited with code " + returnCode + "!"); + failedMessage(name, fullOptionString, valid, "JVM output reports a fatal error. JVM exited with code " + exitCode + "!"); printOutputContent(out); result = false; } else if (valid == true) { - if ((returnCode != 0) && (returnCode != 1)) { - failedMessage(name, fullOptionString, valid, "JVM exited with unexpected error code = " + returnCode); + if ((exitCode != 0) && (exitCode != 1)) { + failedMessage(name, fullOptionString, valid, "JVM exited with unexpected error code = " + exitCode); printOutputContent(out); result = false; - } else if ((returnCode == 1) && (out.getOutput().isEmpty() == true)) { + } else if ((exitCode == 1) && (out.getOutput().isEmpty() == true)) { failedMessage(name, fullOptionString, valid, "JVM exited with error(exitcode == 1)" + ", but with empty stdout and stderr. Description of error is needed!"); result = false; @@ -367,12 +377,12 @@ } } else { // valid == false - if (returnCode == 0) { + if (exitCode == 0) { failedMessage(name, fullOptionString, valid, "JVM successfully exit"); result = false; - } else if (returnCode != 1) { + } else if (exitCode != 1) { failedMessage(name, fullOptionString, valid, "JVM exited with code " - + returnCode + " which not equal to 1"); + + exitCode + " which not equal to 1"); result = false; } else if (!out.getOutput().contains(getErrorMessageCommandLine(value))) { failedMessage(name, fullOptionString, valid, "JVM output does not contain "