< prev index next >

test/gc/arguments/TestUnrecognizedVMOptionsHandling.java

Print this page

        

*** 37,51 **** public class TestUnrecognizedVMOptionsHandling { public static void main(String args[]) throws Exception { // The first two JAVA processes are expected to fail, but with a correct VM option suggestion ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( ! "-XX:+PrintGc", "-version" ); OutputAnalyzer outputWithError = new OutputAnalyzer(pb.start()); ! outputWithError.shouldContain("Did you mean '(+/-)PrintGC'?"); if (outputWithError.getExitValue() == 0) { throw new RuntimeException("Not expected to get exit value 0"); } pb = ProcessTools.createJavaProcessBuilder( --- 37,51 ---- public class TestUnrecognizedVMOptionsHandling { public static void main(String args[]) throws Exception { // The first two JAVA processes are expected to fail, but with a correct VM option suggestion ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( ! "-XX:+UseDynamicNumberOfGcThreads", "-version" ); OutputAnalyzer outputWithError = new OutputAnalyzer(pb.start()); ! outputWithError.shouldContain("Did you mean '(+/-)UseDynamicNumberOfGCThreads'?"); if (outputWithError.getExitValue() == 0) { throw new RuntimeException("Not expected to get exit value 0"); } pb = ProcessTools.createJavaProcessBuilder(
*** 58,71 **** throw new RuntimeException("Not expected to get exit value 0"); } // The last JAVA process should run successfully for the purpose of sanity check pb = ProcessTools.createJavaProcessBuilder( ! "-XX:+PrintGC", "-version" ); OutputAnalyzer outputWithNoError = new OutputAnalyzer(pb.start()); ! outputWithNoError.shouldNotContain("Did you mean '(+/-)PrintGC'?"); outputWithNoError.shouldHaveExitValue(0); } } --- 58,71 ---- throw new RuntimeException("Not expected to get exit value 0"); } // The last JAVA process should run successfully for the purpose of sanity check pb = ProcessTools.createJavaProcessBuilder( ! "-XX:+UseDynamicNumberOfGCThreads", "-version" ); OutputAnalyzer outputWithNoError = new OutputAnalyzer(pb.start()); ! outputWithNoError.shouldNotContain("Did you mean '(+/-)UseDynamicNumberOfGCThreads'?"); outputWithNoError.shouldHaveExitValue(0); } }
< prev index next >