20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 /* |
25 /** |
26 * @test |
26 * @test |
27 * @summary Test relevant combinations of command line flags with shared strings |
27 * @summary Test relevant combinations of command line flags with shared strings |
28 * @requires vm.cds.archived.java.heap |
28 * @requires vm.cds.archived.java.heap & vm.hasJFR |
29 * @library /test/lib /test/hotspot/jtreg/runtime/appcds |
29 * @library /test/lib /test/hotspot/jtreg/runtime/appcds |
30 * @modules java.base/jdk.internal.misc |
30 * @modules java.base/jdk.internal.misc |
31 * @modules java.management |
31 * @modules java.management |
32 * jdk.jartool/sun.tools.jar |
32 * jdk.jartool/sun.tools.jar |
33 * @build HelloString |
33 * @build HelloString |
34 * @run main FlagCombo |
34 * @run main FlagCombo |
35 */ |
35 */ |
36 |
36 |
|
37 /** |
|
38 * @test |
|
39 * @summary Test relevant combinations of command line flags with shared strings |
|
40 * @comment A special test excluding the case that requires JFR |
|
41 * @requires vm.cds.archived.java.heap & !vm.hasJFR |
|
42 * @library /test/lib /test/hotspot/jtreg/runtime/appcds |
|
43 * @modules java.base/jdk.internal.misc |
|
44 * @modules java.management |
|
45 * jdk.jartool/sun.tools.jar |
|
46 * @build HelloString |
|
47 * @run main FlagCombo noJfr |
|
48 */ |
|
49 |
37 import jdk.test.lib.BuildHelper; |
50 import jdk.test.lib.BuildHelper; |
|
51 import jdk.test.lib.Platform; |
38 |
52 |
39 public class FlagCombo { |
53 public class FlagCombo { |
40 public static void main(String[] args) throws Exception { |
54 public static void main(String[] args) throws Exception { |
41 SharedStringsUtils.buildJar("HelloString"); |
55 SharedStringsUtils.buildJar("HelloString"); |
42 |
56 |
43 SharedStringsUtils.dump(TestCommon.list("HelloString"), |
57 SharedStringsUtils.dump(TestCommon.list("HelloString"), |
44 "SharedStringsBasic.txt"); |
58 "SharedStringsBasic.txt"); |
45 |
59 |
46 SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC"); |
60 SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC"); |
47 |
61 |
48 SharedStringsUtils.runWithArchiveAuto("HelloString", |
62 if (args.length == 0) { |
49 "-XX:StartFlightRecording=dumponexit=true"); |
63 SharedStringsUtils.runWithArchiveAuto("HelloString", |
|
64 "-XX:StartFlightRecording=dumponexit=true"); |
|
65 } |
50 |
66 |
51 SharedStringsUtils.runWithArchive("HelloString", "-XX:+UnlockDiagnosticVMOptions", |
67 SharedStringsUtils.runWithArchive("HelloString", "-XX:+UnlockDiagnosticVMOptions", |
52 "-XX:NativeMemoryTracking=detail", "-XX:+PrintNMTStatistics"); |
68 "-XX:NativeMemoryTracking=detail", "-XX:+PrintNMTStatistics"); |
53 } |
69 } |
54 } |
70 } |