< prev index next >
test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java
Print this page
@@ -28,10 +28,15 @@
// A helper/utility class for testing shared strings
public class SharedStringsUtils {
public static final String TEST_JAR_NAME = "test";
public static final String TEST_JAR_NAME_FULL = "test.jar";
public static final String WHITEBOX_JAR_NAME = "whitebox";
+ private static String vmOptionsPrefix[] = {};
+
+ static void setVMOptionsPrefix(String[] opts) {
+ vmOptionsPrefix = opts;
+ }
public static String getWbParam() {
return "-Xbootclasspath/a:" + TestCommon.getTestJar(WHITEBOX_JAR_NAME + ".jar");
}
@@ -53,10 +58,11 @@
String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL);
String[] args =
TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:+UseG1GC",
"-XX:SharedArchiveConfigFile=" +
TestCommon.getSourceFile(sharedDataFile));
+ args = TestCommon.concat(vmOptionsPrefix, args);
return TestCommon.dump(appJar, appClasses, args);
}
// execute the dump operation and check the output
@@ -78,10 +84,11 @@
String... extraOptions) throws Exception {
String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL);
String[] args = TestCommon.concat(extraOptions,
"-cp", appJar, "-XX:+UseCompressedOops", "-XX:+UseG1GC", className);
+ args = TestCommon.concat(vmOptionsPrefix, args);
OutputAnalyzer output = TestCommon.execAuto(args);
checkExecAuto(output);
return output;
}
@@ -96,10 +103,11 @@
String className, String... extraOptions) throws Exception {
String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL);
String[] args = TestCommon.concat(extraOptions,
"-XX:+UseCompressedOops", "-XX:+UseG1GC", className);
+ args = TestCommon.concat(vmOptionsPrefix, args);
OutputAnalyzer output = TestCommon.exec(appJar, args);
checkExec(output, extraMatches);
return output;
}
< prev index next >