< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/NestHostOldInf.java

Print this page

44 
45 public class NestHostOldInf extends DynamicArchiveTestBase {
46     private static final String ARCHIVE_NAME = CDSTestUtils.getOutputFileName("oldclass-top.jsa");
47     private static String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
48     private static String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
49     private static String appJar = ClassFileInstaller.getJarPath("oldclassapp.jar");
50     private static String mainAppClass = "NestHostOldInfApp";
51 
52     public static void main(String[] args) throws Exception {
53         runTest(NestHostOldInf::doTest);
54     }
55 
56     private static void doTest() throws Exception {
57         dump(ARCHIVE_NAME,
58              use_whitebox_jar,
59              "-XX:+UnlockDiagnosticVMOptions",
60              "-XX:+WhiteBoxAPI",
61              "-Xlog:cds",
62              "-Xlog:cds+dynamic=debug",
63              "-cp", appJar,

64              mainAppClass)
65              .assertNormalExit(output -> {
66                  output.shouldContain("Written dynamic archive 0x")
67                        .shouldContain("Skipping ChildOldInf: Old class has been linked")
68                        .shouldContain("Skipping OldInf: Old class has been linked")
69                        .shouldHaveExitValue(0);
70                  });
71 
72         run(ARCHIVE_NAME,
73             use_whitebox_jar,
74             "-XX:+UnlockDiagnosticVMOptions",
75             "-XX:+WhiteBoxAPI",
76             "-Xlog:class+load",
77             "-Xlog:cds=debug",
78             "-Xlog:cds+dynamic=info",
79             "-cp", appJar,
80             mainAppClass)
81             .assertNormalExit(output -> {
82                 output.shouldHaveExitValue(0)
83                       .shouldMatch(".class.load. OldInf source:.*oldclassapp.jar")

44 
45 public class NestHostOldInf extends DynamicArchiveTestBase {
46     private static final String ARCHIVE_NAME = CDSTestUtils.getOutputFileName("oldclass-top.jsa");
47     private static String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
48     private static String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
49     private static String appJar = ClassFileInstaller.getJarPath("oldclassapp.jar");
50     private static String mainAppClass = "NestHostOldInfApp";
51 
52     public static void main(String[] args) throws Exception {
53         runTest(NestHostOldInf::doTest);
54     }
55 
56     private static void doTest() throws Exception {
57         dump(ARCHIVE_NAME,
58              use_whitebox_jar,
59              "-XX:+UnlockDiagnosticVMOptions",
60              "-XX:+WhiteBoxAPI",
61              "-Xlog:cds",
62              "-Xlog:cds+dynamic=debug",
63              "-cp", appJar,
64              "-XX:-PreloadSharedClasses",
65              mainAppClass)
66              .assertNormalExit(output -> {
67                  output.shouldContain("Written dynamic archive 0x")
68                        .shouldContain("Skipping ChildOldInf: Old class has been linked")
69                        .shouldContain("Skipping OldInf: Old class has been linked")
70                        .shouldHaveExitValue(0);
71                  });
72 
73         run(ARCHIVE_NAME,
74             use_whitebox_jar,
75             "-XX:+UnlockDiagnosticVMOptions",
76             "-XX:+WhiteBoxAPI",
77             "-Xlog:class+load",
78             "-Xlog:cds=debug",
79             "-Xlog:cds+dynamic=info",
80             "-cp", appJar,
81             mainAppClass)
82             .assertNormalExit(output -> {
83                 output.shouldHaveExitValue(0)
84                       .shouldMatch(".class.load. OldInf source:.*oldclassapp.jar")
< prev index next >