changeset 47617:44117bc2bedf

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
author hseigel
date Wed, 11 Oct 2017 10:03:22 -0400
parents 4f26db3c02af
children 57cdc5222925 74f5b6c267e3
files test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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");
     }
 }