< prev index next >

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

Print this page

44 public class LambdaContainsOldInf extends DynamicArchiveTestBase {
45     public static void main(String[] args) throws Exception {
46         runTest(LambdaContainsOldInf::test);
47     }
48 
49     static void test() throws Exception {
50         String topArchiveName = getNewArchiveName();
51         String appJar = ClassFileInstaller.getJarPath("lambda_contains_old_inf.jar");
52         String mainClass = "LambdaContainsOldInfApp";
53         String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
54         String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
55 
56         String[] mainArgs = { "dummy", "addLambda" };
57 
58         for (String mainArg : mainArgs) {
59 
60             dump(topArchiveName,
61                 "-XX:+UnlockDiagnosticVMOptions",
62                 "-XX:+WhiteBoxAPI",
63                 "-Xlog:class+load=debug,cds=debug,cds+dynamic=info",

64                 use_whitebox_jar,
65                 "-cp", appJar, mainClass, mainArg)
66                 .assertNormalExit(output -> {
67                     output.shouldContain("Skipping OldProvider: Old class has been linked")
68                           .shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda.*0x.*:.*Old.class.has.been.linked")
69                           .shouldHaveExitValue(0);
70             });
71 
72             run(topArchiveName,
73                 "-XX:+UnlockDiagnosticVMOptions",
74                 "-XX:+WhiteBoxAPI",
75                 use_whitebox_jar,
76                 "-Xlog:class+load=debug",
77                 "-cp", appJar, mainClass, mainArg)
78                 .assertNormalExit(output -> {
79                     output.shouldContain("[class,load] LambdaContainsOldInfApp source: shared objects file (top)")
80                           .shouldMatch(".class.load. OldProvider.source:.*lambda_contains_old_inf.jar")
81                           .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda.*/0x.*source:.*LambdaContainsOldInf")
82                           .shouldHaveExitValue(0);
83             });

44 public class LambdaContainsOldInf extends DynamicArchiveTestBase {
45     public static void main(String[] args) throws Exception {
46         runTest(LambdaContainsOldInf::test);
47     }
48 
49     static void test() throws Exception {
50         String topArchiveName = getNewArchiveName();
51         String appJar = ClassFileInstaller.getJarPath("lambda_contains_old_inf.jar");
52         String mainClass = "LambdaContainsOldInfApp";
53         String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
54         String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
55 
56         String[] mainArgs = { "dummy", "addLambda" };
57 
58         for (String mainArg : mainArgs) {
59 
60             dump(topArchiveName,
61                 "-XX:+UnlockDiagnosticVMOptions",
62                 "-XX:+WhiteBoxAPI",
63                 "-Xlog:class+load=debug,cds=debug,cds+dynamic=info",
64                 "-XX:-PreloadSharedClasses",
65                 use_whitebox_jar,
66                 "-cp", appJar, mainClass, mainArg)
67                 .assertNormalExit(output -> {
68                     output.shouldContain("Skipping OldProvider: Old class has been linked")
69                           .shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda.*0x.*:.*Old.class.has.been.linked")
70                           .shouldHaveExitValue(0);
71             });
72 
73             run(topArchiveName,
74                 "-XX:+UnlockDiagnosticVMOptions",
75                 "-XX:+WhiteBoxAPI",
76                 use_whitebox_jar,
77                 "-Xlog:class+load=debug",
78                 "-cp", appJar, mainClass, mainArg)
79                 .assertNormalExit(output -> {
80                     output.shouldContain("[class,load] LambdaContainsOldInfApp source: shared objects file (top)")
81                           .shouldMatch(".class.load. OldProvider.source:.*lambda_contains_old_inf.jar")
82                           .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda.*/0x.*source:.*LambdaContainsOldInf")
83                           .shouldHaveExitValue(0);
84             });
< prev index next >