< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/customLoader/OldClassAndInf.java

Print this page

 40  * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
 41  * @run driver OldClassAndInf
 42  */
 43 
 44 import jdk.test.lib.process.OutputAnalyzer;
 45 import jdk.test.lib.helpers.ClassFileInstaller;
 46 import sun.hotspot.WhiteBox;
 47 
 48 public class OldClassAndInf {
 49     static String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
 50     static String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
 51     static String appJar = ClassFileInstaller.getJarPath("oldclassapp.jar");
 52     static String loadeesJar = ClassFileInstaller.getJarPath("loadees.jar");
 53     static String loadeesJar2 = ClassFileInstaller.getJarPath("loadees2.jar");
 54 
 55     public static void main(String[] args) throws Exception {
 56 
 57         String classlist[] = new String[] {
 58             "OldClassApp",
 59             "java/lang/Object id: 1",
 60             "OldSuper id: 2 super: 1 source: " + loadeesJar,
 61             "ChildOldSuper id: 3 super: 2 source: " + loadeesJar,
 62             "GChild id: 4 super: 3 source: " + loadeesJar

 63         };
 64         doTest(classlist, loadeesJar, "true",  "OldSuper", "ChildOldSuper", "GChild");
 65 
 66         String classlist2[] = new String[] {
 67             "OldClassApp",
 68             "java/lang/Object id: 1",
 69             "OldInf id: 2 super: 1 source: " + loadeesJar2,
 70             "ChildOldInf id: 3 super: 1 interfaces: 2 source: " + loadeesJar2,
 71             "GChild2 id: 4 super: 3 source: " + loadeesJar2

 72         };
 73         doTest(classlist2, loadeesJar2, "true", "OldInf", "ChildOldInf", "GChild2");
 74     }
 75 
 76     public static void doTest(String[] classlist, String loadeesJar, String inArchive, String ...loadees) throws Exception {
 77 
 78         OutputAnalyzer output;
 79         TestCommon.testDump(appJar, classlist,
 80                             "-Xlog:cds=debug,class+load",
 81                             use_whitebox_jar);
 82 
 83         output = TestCommon.exec(appJar,
 84                                  TestCommon.concat(
 85                                      TestCommon.list(
 86                                          use_whitebox_jar,
 87                                          "-Xlog:class+load,cds=debug",
 88                                          "-XX:+UnlockDiagnosticVMOptions",
 89                                          "-XX:+WhiteBoxAPI",
 90                                          "OldClassApp", loadeesJar, inArchive),
 91                                      loadees));

 40  * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
 41  * @run driver OldClassAndInf
 42  */
 43 
 44 import jdk.test.lib.process.OutputAnalyzer;
 45 import jdk.test.lib.helpers.ClassFileInstaller;
 46 import sun.hotspot.WhiteBox;
 47 
 48 public class OldClassAndInf {
 49     static String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
 50     static String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
 51     static String appJar = ClassFileInstaller.getJarPath("oldclassapp.jar");
 52     static String loadeesJar = ClassFileInstaller.getJarPath("loadees.jar");
 53     static String loadeesJar2 = ClassFileInstaller.getJarPath("loadees2.jar");
 54 
 55     public static void main(String[] args) throws Exception {
 56 
 57         String classlist[] = new String[] {
 58             "OldClassApp",
 59             "java/lang/Object id: 1",
 60             "java/lang/IdentityObject id: 2",
 61             "OldSuper id: 3 super: 1 interfaces: 2 source: " + loadeesJar,
 62             "ChildOldSuper id: 4 super: 3 source: " + loadeesJar,
 63             "GChild id: 5 super: 4 source: " + loadeesJar
 64         };
 65         doTest(classlist, loadeesJar, "true",  "OldSuper", "ChildOldSuper", "GChild");
 66 
 67         String classlist2[] = new String[] {
 68             "OldClassApp",
 69             "java/lang/Object id: 1",
 70             "java/lang/IdentityObject id: 2",
 71             "OldInf id: 3 super: 1 source: " + loadeesJar2,
 72             "ChildOldInf id: 4 super: 1 interfaces: 2 3 source: " + loadeesJar2,
 73             "GChild2 id: 5 super: 4 source: " + loadeesJar2
 74         };
 75         doTest(classlist2, loadeesJar2, "true", "OldInf", "ChildOldInf", "GChild2");
 76     }
 77 
 78     public static void doTest(String[] classlist, String loadeesJar, String inArchive, String ...loadees) throws Exception {
 79 
 80         OutputAnalyzer output;
 81         TestCommon.testDump(appJar, classlist,
 82                             "-Xlog:cds=debug,class+load",
 83                             use_whitebox_jar);
 84 
 85         output = TestCommon.exec(appJar,
 86                                  TestCommon.concat(
 87                                      TestCommon.list(
 88                                          use_whitebox_jar,
 89                                          "-Xlog:class+load,cds=debug",
 90                                          "-XX:+UnlockDiagnosticVMOptions",
 91                                          "-XX:+WhiteBoxAPI",
 92                                          "OldClassApp", loadeesJar, inArchive),
 93                                      loadees));
< prev index next >