8188922: [TESTBUG] runtime/CommandLine/VMDeprecatedOptions.java fails with JDK10 release bits
authorhseigel
Wed, 11 Oct 2017 10:03:22 -0400
changeset 47617 44117bc2bedf
parent 47616 4f26db3c02af
child 47618 57cdc5222925
child 47619 74f5b6c267e3
8188922: [TESTBUG] runtime/CommandLine/VMDeprecatedOptions.java fails with JDK10 release bits Summary: Add -XX:+UnlockDiagnosticVMOptions to the command line when testing a deprecated diagnostic option. Reviewed-by: coleenp, lfoltan
test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
--- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Fri Sep 15 14:47:13 2017 +0200
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Wed Oct 11 10:03:22 2017 -0400
@@ -42,7 +42,6 @@
         // deprecated non-alias flags:
         {"MaxGCMinorPauseMillis",     "1032"},
         {"MustCallLoadClassInternal", "false"},
-        {"UnsyncloadClass",           "false"},
         {"MaxRAMFraction",            "8"},
         {"MinRAMFraction",            "2"},
         {"InitialRAMFraction",        "64"},
@@ -76,7 +75,21 @@
         }
     }
 
+    // Deprecated diagnostic command line options need to be preceded on the
+    // command line by -XX:+UnlockDiagnosticVMOptions.
+    static void testDeprecatedDiagnostic(String option, String value)  throws Throwable {
+        String XXoption = CommandLineOptionTest.prepareFlag(option, value);
+        ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
+            CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS, XXoption, "-version");
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        // check for option deprecation message:
+        output.shouldHaveExitValue(0);
+        String match = getDeprecationString(option);
+        output.shouldMatch(match);
+    }
+
     public static void main(String[] args) throws Throwable {
         testDeprecated(DEPRECATED_OPTIONS);  // Make sure that each deprecated option is mentioned in the output.
+        testDeprecatedDiagnostic("UnsyncloadClass", "false");
     }
 }