< prev index next >

test/hotspot/jtreg/runtime/appcds/TestCommon.java

Print this page

@@ -198,10 +198,16 @@
         AppCDSOptions opts = (new AppCDSOptions());
         opts.addSuffix(suffix);
         return new Result(opts, runWithArchive(opts));
     }
 
+    public static Result runWithModules(String prefix[], String upgrademodulepath, String modulepath,
+                                            String mid, String... testClassArgs) throws Exception {
+        AppCDSOptions opts = makeModuleOptions(prefix, upgrademodulepath, modulepath,
+                                               mid, testClassArgs);
+        return new Result(opts, runWithArchive(opts));
+    }
 
     public static OutputAnalyzer exec(String appJar, String... suffix) throws Exception {
         AppCDSOptions opts = (new AppCDSOptions()).setAppJar(appJar);
         opts.addSuffix(suffix);
         return runWithArchive(opts);

@@ -218,25 +224,31 @@
         AppCDSOptions opts = (new AppCDSOptions());
         opts.addSuffix(suffix).setXShareMode("off");
         return runWithArchive(opts);
     }
 
-    public static OutputAnalyzer execModule(String prefix[], String upgrademodulepath, String modulepath,
-                                            String mid, String... testClassArgs)
-        throws Exception {
 
+    private static AppCDSOptions makeModuleOptions(String prefix[], String upgrademodulepath, String modulepath,
+                                            String mid, String testClassArgs[]) {
         AppCDSOptions opts = (new AppCDSOptions());
 
         opts.addPrefix(prefix);
         if (upgrademodulepath == null) {
             opts.addSuffix("-p", modulepath, "-m", mid);
         } else {
             opts.addSuffix("--upgrade-module-path", upgrademodulepath,
                            "-p", modulepath, "-m", mid);
         }
         opts.addSuffix(testClassArgs);
+        return opts;
+    }
 
+    public static OutputAnalyzer execModule(String prefix[], String upgrademodulepath, String modulepath,
+                                            String mid, String... testClassArgs)
+        throws Exception {
+        AppCDSOptions opts = makeModuleOptions(prefix, upgrademodulepath, modulepath,
+                                               mid, testClassArgs);
         return runWithArchive(opts);
     }
 
 
     // A common operation: dump, then check results
< prev index next >