< 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,53 ---- * @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 */ 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 { + SharedStringsUtils.run(args, SharedStringsStress::test); + } + + public static void test(String[] args) throws Exception { + String vmOptionsPrefix[] = SharedStringsUtils.getChildVMOptionsPrefix(); + 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); } } --- 60,72 ---- } 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 >