--- old/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java 2017-11-29 12:36:36.580935414 +0100 +++ new/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java 2017-11-29 12:36:36.352926355 +0100 @@ -39,12 +39,20 @@ import jdk.test.lib.process.ProcessTools; public class TestVerifyGCType { - public static final String VERIFY_TAG = "[gc,verify]"; - public static final String VERIFY_BEFORE = "Verifying Before GC"; - public static final String VERIFY_DURING = "Verifying During GC"; - public static final String VERIFY_AFTER = "Verifying After GC"; + public static final String VERIFY_TAG = "[gc,verify]"; + public static final String VERIFY_BEFORE = "Verifying Before GC"; + public static final String VERIFY_DURING = "Verifying During GC"; + public static final String VERIFY_AFTER = "Verifying After GC"; public static void main(String args[]) throws Exception { + testAllVerificationEnabled(); + testAllExplicitlyEnabled(); + testFullAndRemark(); + testBadVerificationType(); + testUnsupportedCollector(); + } + + private static void testAllVerificationEnabled() throws Exception { // Test with all verification enabled OutputAnalyzer output = testWithVerificationType(new String[0]); output.shouldHaveExitValue(0); @@ -53,7 +61,10 @@ verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, true, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); + } + private static void testAllExplicitlyEnabled() throws Exception { + OutputAnalyzer output; // Test with all explicitly enabled output = testWithVerificationType(new String[] {"young", "remark", "cleanup", "full"}); output.shouldHaveExitValue(0); @@ -62,7 +73,10 @@ verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, true, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); + } + private static void testFullAndRemark() throws Exception { + OutputAnalyzer output; // Test with full and remark output = testWithVerificationType(new String[] {"remark", "full"}); output.shouldHaveExitValue(0); @@ -71,17 +85,23 @@ verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, false, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); + } + private static void testBadVerificationType() throws Exception { + OutputAnalyzer output; // Test bad type output = testWithVerificationType(new String[] {"old"}); output.shouldHaveExitValue(0); - output.shouldMatch("VerifyGCType: '.*' is unknown. Available are: young, mixed, remark, cleanup and full "); + output.shouldMatch("VerifyGCType: '.*' is unknown. Available types are: young, mixed, remark, cleanup and full"); verifyCollection("Pause Young", true, false, true, output.getStdout()); verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, true, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); + } + private static void testUnsupportedCollector() throws Exception { + OutputAnalyzer output; // Test bad gc output = testWithBadGC(); output.shouldHaveExitValue(0);