< prev index next >
test/hotspot/jtreg/runtime/appcds/TestCommon.java
Print this page
@@ -147,10 +147,16 @@
// 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<String> cmd = new ArrayList<String>();
for (String p : opts.prefix) cmd.add(p);
@@ -166,11 +172,11 @@
for (String s : opts.suffix) cmd.add(s);
String[] cmdLine = cmd.toArray(new String[cmd.size()]);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, cmdLine);
- return executeAndLog(pb, "exec");
+ return pb;
}
public static OutputAnalyzer execCommon(String... suffix) throws Exception {
AppCDSOptions opts = (new AppCDSOptions());
@@ -203,10 +209,16 @@
AppCDSOptions opts = (new AppCDSOptions());
opts.addSuffix(suffix).setXShareMode("auto");
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");
return runWithArchive(opts);
}
< prev index next >