< prev index next >

test/hotspot/jtreg/serviceability/sa/TestUniverse.java

Print this page

        

@@ -32,14 +32,25 @@
 import jdk.test.lib.process.OutputAnalyzer;
 
 /*
  * @test
  * @summary Test the 'universe' command of jhsdb clhsdb.
+ * @requires vm.gc != "Z"
  * @bug 8190307
  * @library /test/lib
  * @build jdk.test.lib.apps.*
- * @run main/othervm TestUniverse
+ * @run main/othervm 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.*
+ * @run main/othervm TestUniverse withZ
  */
 
 public class TestUniverse {
 
     private static void testClhsdbForUniverse(long lingeredAppPid,

@@ -100,17 +111,23 @@
         if (gc.contains("UseParallelGC")) {
             output.shouldContain("ParallelScavengeHeap");
             output.shouldContain("PSYoungGen");
             output.shouldContain("eden");
         }
+        if (gc.contains("UseZGC")) {
+            output.shouldContain("ZHeap");
+        }
 
     }
 
     public static void test(String gc) throws Exception {
         LingeredApp app = null;
         try {
             List<String> vmArgs = new ArrayList<String>();
+            if (gc.contains("UseZGC")) {
+              vmArgs.add("-XX:+UnlockExperimentalVMOptions");
+            }
             vmArgs.add(gc);
             app = LingeredApp.startApp(vmArgs);
             System.out.println ("Started LingeredApp with the GC option " + gc +
                                 " and pid " + app.getPid());
             testClhsdbForUniverse(app.getPid(), gc);

@@ -131,10 +148,14 @@
         try {
             test("-XX:+UseG1GC");
             test("-XX:+UseParallelGC");
             test("-XX:+UseSerialGC");
             test("-XX:+UseConcMarkSweepGC");
+            if (args[0].equals("withZ")) {
+              test("-XX:+UseZGC");
+            }
+
         } catch (Exception e) {
             throw new Error("Test failed with " + e);
         }
     }
 }
< prev index next >