< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/OldSuperInfIndirect.java

Print this page

36  * @run driver OldSuperInfIndirect
37  */
38 
39 import jdk.test.lib.cds.CDSTestUtils;
40 import jdk.test.lib.process.OutputAnalyzer;
41 
42 public class OldSuperInfIndirect {
43 
44     public static void main(String[] args) throws Exception {
45         String mainClass = "IndirectImpInfApp";
46         String namePrefix = "indirectimpinfapp";
47         String appClasses[] = TestCommon.list("OldInf", "InfMethod", "IndirectImpInf", mainClass);
48         JarBuilder.build(namePrefix, appClasses);
49 
50         String appJar = TestCommon.getTestJar(namePrefix + ".jar");
51         String archiveName = namePrefix + ".jsa";
52 
53         boolean dynamicMode = CDSTestUtils.DYNAMIC_DUMP;
54 
55         // create archive with class list
56         OutputAnalyzer output = TestCommon.dump(appJar, appClasses, "-Xlog:class+load,cds=debug,verification=trace");

57         TestCommon.checkExecReturn(output, 0,
58                                    dynamicMode ? true : false,
59                                    "Skipping OldInf: Old class has been linked",
60                                    "Skipping IndirectImpInf: Old class has been linked");
61 
62         // run with archive
63         TestCommon.run(
64             "-cp", appJar,
65             "-Xlog:class+load,cds=debug,verification=trace",
66             mainClass)
67           .assertNormalExit(out -> {
68               out.shouldContain("Verifying class OldInf with old format")
69                  .shouldContain("Verifying class IndirectImpInf with new format");
70               if (!dynamicMode) {
71                   out.shouldContain("OldInf source: shared objects file")
72                      .shouldContain("InfMethod source: shared objects file")
73                      .shouldContain("IndirectImpInf source: shared objects file");
74               } else {
75                   // Old classes were already linked before dynamic dump happened,
76                   // so they couldn't be archived.

36  * @run driver OldSuperInfIndirect
37  */
38 
39 import jdk.test.lib.cds.CDSTestUtils;
40 import jdk.test.lib.process.OutputAnalyzer;
41 
42 public class OldSuperInfIndirect {
43 
44     public static void main(String[] args) throws Exception {
45         String mainClass = "IndirectImpInfApp";
46         String namePrefix = "indirectimpinfapp";
47         String appClasses[] = TestCommon.list("OldInf", "InfMethod", "IndirectImpInf", mainClass);
48         JarBuilder.build(namePrefix, appClasses);
49 
50         String appJar = TestCommon.getTestJar(namePrefix + ".jar");
51         String archiveName = namePrefix + ".jsa";
52 
53         boolean dynamicMode = CDSTestUtils.DYNAMIC_DUMP;
54 
55         // create archive with class list
56         OutputAnalyzer output = TestCommon.dump(appJar, appClasses, "-Xlog:class+load,cds=debug,verification=trace",
57                                                 "-XX:-PreloadSharedClasses");
58         TestCommon.checkExecReturn(output, 0,
59                                    dynamicMode ? true : false,
60                                    "Skipping OldInf: Old class has been linked",
61                                    "Skipping IndirectImpInf: Old class has been linked");
62 
63         // run with archive
64         TestCommon.run(
65             "-cp", appJar,
66             "-Xlog:class+load,cds=debug,verification=trace",
67             mainClass)
68           .assertNormalExit(out -> {
69               out.shouldContain("Verifying class OldInf with old format")
70                  .shouldContain("Verifying class IndirectImpInf with new format");
71               if (!dynamicMode) {
72                   out.shouldContain("OldInf source: shared objects file")
73                      .shouldContain("InfMethod source: shared objects file")
74                      .shouldContain("IndirectImpInf source: shared objects file");
75               } else {
76                   // Old classes were already linked before dynamic dump happened,
77                   // so they couldn't be archived.
< prev index next >