--- old/test/hotspot/jtreg/runtime/appcds/TestCommon.java 2019-03-24 20:44:09.202196785 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/TestCommon.java 2019-03-24 20:44:09.050191408 -0700 @@ -149,6 +149,12 @@ // Execute JVM using AppCDS archive with specified AppCDSOptions public static OutputAnalyzer runWithArchive(AppCDSOptions opts) throws Exception { + ProcessBuilder pb = createProcessBuilderWithArchive(opts); + return executeAndLog(pb, "exec"); + } + + public static ProcessBuilder createProcessBuilderWithArchive(AppCDSOptions opts) + throws Exception { ArrayList cmd = new ArrayList(); @@ -168,7 +174,7 @@ String[] cmdLine = cmd.toArray(new String[cmd.size()]); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, cmdLine); - return executeAndLog(pb, "exec"); + return pb; } @@ -205,6 +211,12 @@ return runWithArchive(opts); } + public static ProcessBuilder createProcessBuilderWithAutoArchive(String... suffix) throws Exception { + AppCDSOptions opts = (new AppCDSOptions()); + opts.addSuffix(suffix).setXShareMode("auto"); + return createProcessBuilderWithArchive(opts); + } + public static OutputAnalyzer execOff(String... suffix) throws Exception { AppCDSOptions opts = (new AppCDSOptions()); opts.addSuffix(suffix).setXShareMode("off");