< prev index next >

test/gc/startup_warnings/TestCMS.java

Print this page
rev 11983 : 8155948: Add message for CMS deprecation for some internal builds
Reviewed-by: drwhite
* * *
Reviewed-by: kbarrett, dholmes

*** 22,48 **** */ /* * @test TestCMS * @key gc ! * @bug 8006398 ! * @summary Test that CMS does not print a warning message * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; ! public class TestCMS { ! public static void main(String args[]) throws Exception { ! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseConcMarkSweepGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } } --- 22,60 ---- */ /* * @test TestCMS * @key gc ! * @bug 8006398 8155948 ! * @summary Test that CMS prints a warning message only for a commercial build * @library /test/lib * @modules java.base/jdk.internal.misc * java.management */ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; ! import jdk.test.lib.BuildHelper; public class TestCMS { ! public static void runTest(String[] args) throws Exception { ! boolean isCommercial = BuildHelper.isCommercialBuild(); ! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); + if (isCommercial) { + output.shouldContain("deprecated"); + } else { output.shouldNotContain("deprecated"); + } output.shouldNotContain("error"); output.shouldHaveExitValue(0); } + public static void main(String args[]) throws Exception { + runTest(new String[] {"-XX:+UseConcMarkSweepGC", "-version"}); + runTest(new String[] {"-Xconcgc", "-version"}); + runTest(new String[] {"-Xnoconcgc", "-version"}); + runTest(new String[] {"-XX:+UseAutoGCSelectPolicy", "-XX:MaxGCPauseMillis=100", "-XX:AutoGCSelectPauseMillis=200", "-version"}); + } + }
< prev index next >