test/runtime/SharedArchiveFile/SharedArchiveFile.java
Print this page
*** 23,32 ****
--- 23,33 ----
/*
* @test
* @bug 8014138
* @summary Testing new -XX:SharedArchiveFile=<file-name> option
+ * @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
*/
*** 38,55 ****
// NOTE: This test serves as a sanity test and also as an example for simple
// use of SharedArchiveFile argument. For this reason it DOES NOT use the utility
// methods to form command line to create/use shared archive.
public class SharedArchiveFile {
public static void main(String[] args) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
"-Xshare:dump");
OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
CDSTestUtils.checkDump(out);
! pb = ProcessTools.createJavaProcessBuilder(
"-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
"-Xshare:on", "-version");
out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
CDSTestUtils.checkExec(out);
--- 39,56 ----
// NOTE: This test serves as a sanity test and also as an example for simple
// use of SharedArchiveFile argument. For this reason it DOES NOT use the utility
// methods to form command line to create/use shared archive.
public class SharedArchiveFile {
public static void main(String[] args) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
"-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
"-Xshare:dump");
OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
CDSTestUtils.checkDump(out);
! pb = ProcessTools.createJavaProcessBuilder(true,
"-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
"-Xshare:on", "-version");
out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
CDSTestUtils.checkExec(out);