31 |
31 |
32 import com.oracle.java.testlibrary.*; |
32 import com.oracle.java.testlibrary.*; |
33 |
33 |
34 public class XShareAuto { |
34 public class XShareAuto { |
35 public static void main(String[] args) throws Exception { |
35 public static void main(String[] args) throws Exception { |
36 if (!Platform.is64bit()) { |
|
37 System.out.println("ObjectAlignmentInBytes for CDS is only " + |
|
38 "supported on 64bit platforms; this plaform is " + |
|
39 System.getProperty("sun.arch.data.model")); |
|
40 System.out.println("Skipping the test"); |
|
41 return; |
|
42 } |
|
43 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
36 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
44 "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", |
37 "-server", "-XX:+UnlockDiagnosticVMOptions", |
45 "-Xshare:dump"); |
38 "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); |
46 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
39 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
47 output.shouldContain("Loading classes to share"); |
40 output.shouldContain("Loading classes to share"); |
48 output.shouldHaveExitValue(0); |
41 output.shouldHaveExitValue(0); |
49 |
42 |
50 pb = ProcessTools.createJavaProcessBuilder( |
43 pb = ProcessTools.createJavaProcessBuilder( |