< prev index next >
test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java
Print this page
*** 28,49 ****
* @requires vm.cds.archived.java.heap
* @library /test/hotspot/jtreg/runtime/appcds /test/lib
* @modules jdk.jartool/sun.tools.jar
* @build HelloString
* @run driver SharedStringsStress
! * @run main/othervm -XX:+UseStringDeduplication SharedStringsStress
! * @run main/othervm -XX:-CompactStrings SharedStringsStress
*/
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
public class SharedStringsStress {
public static void main(String[] args) throws Exception {
String appJar = JarBuilder.build("SharedStringsStress", "HelloString");
String sharedArchiveConfigFile = System.getProperty("user.dir") + File.separator + "SharedStringsStress_gen.txt";
try (FileOutputStream fos = new FileOutputStream(sharedArchiveConfigFile)) {
PrintWriter out = new PrintWriter(new OutputStreamWriter(fos));
--- 28,50 ----
* @requires vm.cds.archived.java.heap
* @library /test/hotspot/jtreg/runtime/appcds /test/lib
* @modules jdk.jartool/sun.tools.jar
* @build HelloString
* @run driver SharedStringsStress
! * @run driver SharedStringsStress -XX:+UseStringDeduplication
! * @run driver SharedStringsStress -XX:-CompactStrings
*/
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
public class SharedStringsStress {
public static void main(String[] args) throws Exception {
+ String vmOptionsPrefix[] = args;
String appJar = JarBuilder.build("SharedStringsStress", "HelloString");
String sharedArchiveConfigFile = System.getProperty("user.dir") + File.separator + "SharedStringsStress_gen.txt";
try (FileOutputStream fos = new FileOutputStream(sharedArchiveConfigFile)) {
PrintWriter out = new PrintWriter(new OutputStreamWriter(fos));
*** 56,66 ****
}
out.close();
}
OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"),
! "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile);
TestCommon.checkDump(dumpOutput);
! OutputAnalyzer execOutput = TestCommon.exec(appJar, "HelloString");
TestCommon.checkExec(execOutput);
}
}
--- 57,69 ----
}
out.close();
}
OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"),
! TestCommon.concat(vmOptionsPrefix,
! "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile));
TestCommon.checkDump(dumpOutput);
! OutputAnalyzer execOutput = TestCommon.exec(appJar,
! TestCommon.concat(vmOptionsPrefix, "HelloString"));
TestCommon.checkExec(execOutput);
}
}
< prev index next >