test/hotspot/jtreg/serviceability/sa/TestUniverse.java
changeset 50525 767cdb97f103
parent 50523 7b7c75d87f9b
child 50589 e5d741569070
--- a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java	Tue Jun 12 07:52:30 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java	Tue Jun 12 17:40:28 2018 +0200
@@ -36,12 +36,25 @@
 /*
  * @test
  * @summary Test the 'universe' command of jhsdb clhsdb.
+ * @requires vm.gc != "Z"
  * @bug 8190307
  * @library /test/lib
  * @build jdk.test.lib.apps.*
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse withoutZ
+ */
+
+/*
+ * @test
+ * @summary Test the 'universe' command of jhsdb clhsdb.
+ * @requires vm.gc == "Z"
+ * @bug 8190307
+ * @library /test/lib
+ * @build jdk.test.lib.apps.*
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse withZ
  */
 
 public class TestUniverse {
@@ -84,6 +97,9 @@
             p.destroyForcibly();
             throw new Error("Problem awaiting the child process: " + ie, ie);
         }
+        if (gc.contains("UseZGC")) {
+            output.shouldContain("ZHeap");
+        }
 
         output.shouldHaveExitValue(0);
         System.out.println(output.getOutput());
@@ -142,8 +158,11 @@
             test("-XX:+UseG1GC");
             test("-XX:+UseParallelGC");
             test("-XX:+UseSerialGC");
-            if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
-              test("-XX:+UseConcMarkSweepGC");
+            if (!Compiler.isGraalEnabled()) { // Graal does not support all GCs
+                test("-XX:+UseConcMarkSweepGC");
+                if (args[0].equals("withZ")) {
+                    test("-XX:+UseZGC");
+                }
             }
             test("-XX:+UseEpsilonGC");
         } catch (Exception e) {