--- 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);