< prev index next >

test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasic.java

Print this page

*** 25,71 **** /* * @test * @summary Basic test for shared strings * @requires vm.cds.archived.java.heap * @library /test/hotspot/jtreg/runtime/appcds /test/lib ! * @modules java.base/jdk.internal.misc ! * @modules java.management ! * jdk.jartool/sun.tools.jar * @build HelloString * @run driver SharedStringsBasic ! * @run main/othervm -XX:+UseStringDeduplication SharedStringsBasic ! * @run main/othervm -XX:-CompactStrings SharedStringsBasic */ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; // This test does not use SharedStringsUtils intentionally: // - in order to demonstrate the basic use of the functionality // - to provide sanity check and catch potential problems in the utils public class SharedStringsBasic { public static void main(String[] args) throws Exception { String appJar = JarBuilder.build("SharedStringsBasic", "HelloString"); String sharedArchiveConfigFile = TestCommon.getSourceFile("SharedStringsBasic.txt").toString(); ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true, "-cp", appJar, "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile, "-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-Xshare:dump", ! "-Xlog:cds,cds+hashtables"); TestCommon.executeAndLog(dumpPb, "dump") .shouldContain("Shared string table stats") .shouldHaveExitValue(0); ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true, "-cp", appJar, "-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-Xshare:auto", "-showversion", ! "HelloString"); TestCommon.executeAndLog(runPb, "run").shouldHaveExitValue(0); } } --- 25,73 ---- /* * @test * @summary Basic test for shared strings * @requires vm.cds.archived.java.heap * @library /test/hotspot/jtreg/runtime/appcds /test/lib ! * @modules jdk.jartool/sun.tools.jar * @build HelloString * @run driver SharedStringsBasic ! * @run driver SharedStringsBasic -XX:+UseStringDeduplication ! * @run driver SharedStringsBasic -XX:-CompactStrings */ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; // This test does not use SharedStringsUtils intentionally: // - in order to demonstrate the basic use of the functionality // - to provide sanity check and catch potential problems in the utils public class SharedStringsBasic { public static void main(String[] args) throws Exception { + String vmOptionsPrefix[] = args; + String appJar = JarBuilder.build("SharedStringsBasic", "HelloString"); String sharedArchiveConfigFile = TestCommon.getSourceFile("SharedStringsBasic.txt").toString(); ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-cp", appJar, "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile, "-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-Xshare:dump", ! "-Xlog:cds,cds+hashtables")); TestCommon.executeAndLog(dumpPb, "dump") .shouldContain("Shared string table stats") .shouldHaveExitValue(0); ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-cp", appJar, "-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-Xshare:auto", "-showversion", ! "HelloString")); TestCommon.executeAndLog(runPb, "run").shouldHaveExitValue(0); } }
< prev index next >