test/hotspot/jtreg/runtime/appcds/TestCommon.java
changeset 48979 514c73a1955b
parent 48516 7d286141598c
child 49739 00805b129186
--- a/test/hotspot/jtreg/runtime/appcds/TestCommon.java	Thu Feb 15 09:22:25 2018 -0800
+++ b/test/hotspot/jtreg/runtime/appcds/TestCommon.java	Wed Feb 14 07:08:25 2018 -0800
@@ -28,6 +28,7 @@
 import jdk.test.lib.Platform;
 import jdk.test.lib.cds.CDSOptions;
 import jdk.test.lib.cds.CDSTestUtils;
+import jdk.test.lib.cds.CDSTestUtils.Result;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 import java.io.File;
@@ -191,6 +192,14 @@
         return runWithArchive(opts);
     }
 
+    // This is the new API for running a Java process with CDS enabled.
+    // See comments in the CDSTestUtils.Result class for how to use this method.
+    public static Result run(String... suffix) throws Exception {
+        AppCDSOptions opts = (new AppCDSOptions());
+        opts.addSuffix(suffix);
+        return new Result(opts, runWithArchive(opts));
+    }
+
 
     public static OutputAnalyzer exec(String appJar, String... suffix) throws Exception {
         AppCDSOptions opts = (new AppCDSOptions()).setAppJar(appJar);