< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/LoaderConstraintsTest.java

Print this page

 58     static String httpExchangeClass = HttpExchange.class.getName().replace(".", "/");
 59     static String appJar = null;
 60     static String appClasses[] = {
 61         mainClass,
 62         httpHandlerClass,
 63         httpExchangeClass,
 64         Asserts.class.getName(),
 65         MyHttpHandler.class.getName(),
 66         MyHttpHandlerB.class.getName(),
 67         MyHttpHandlerC.class.getName(),
 68         MyClassLoader.class.getName()
 69     };
 70 
 71     static String loaderMainClass = CustomAppLoader.class.getName();
 72     static String loaderJar = null;
 73     static String loaderClasses[] = {
 74         loaderMainClass
 75     };
 76 
 77     static void doTest() throws Exception  {
 78         TestCommon.dump(appJar, appClasses, "-Xlog:cds");
 79         String cmdLine[] =
 80             TestCommon.concat("-cp", appJar,
 81                               "-Xlog:cds",
 82                               "-Xlog:class+loader+constraints=debug",
 83                               "--add-exports",
 84                               "java.base/jdk.internal.misc=ALL-UNNAMED",
 85                               mainClass);
 86         runWithArchive(cmdLine, "1");
 87         runWithArchive(cmdLine, "2");
 88         runWithArchive(cmdLine, "3");
 89     }
 90 
 91     // Same as doTest, except that LoaderConstraintsApp and MyHttpHandler* are loaded
 92     // by a custom loader. This is test case for JDK-8267347.
 93     static void doTestCustomLoader() throws Exception  {
 94         String src = " source: " + appJar;
 95         String classList[] =
 96             TestCommon.concat(loaderClasses,
 97                               "java/lang/Object id: 1",
 98                               mainClass + " id: 2 super: 1" + src,

 58     static String httpExchangeClass = HttpExchange.class.getName().replace(".", "/");
 59     static String appJar = null;
 60     static String appClasses[] = {
 61         mainClass,
 62         httpHandlerClass,
 63         httpExchangeClass,
 64         Asserts.class.getName(),
 65         MyHttpHandler.class.getName(),
 66         MyHttpHandlerB.class.getName(),
 67         MyHttpHandlerC.class.getName(),
 68         MyClassLoader.class.getName()
 69     };
 70 
 71     static String loaderMainClass = CustomAppLoader.class.getName();
 72     static String loaderJar = null;
 73     static String loaderClasses[] = {
 74         loaderMainClass
 75     };
 76 
 77     static void doTest() throws Exception  {
 78         TestCommon.dump(appJar, appClasses, "-Xlog:cds", "-XX:-PreloadSharedClasses");
 79         String cmdLine[] =
 80             TestCommon.concat("-cp", appJar,
 81                               "-Xlog:cds",
 82                               "-Xlog:class+loader+constraints=debug",
 83                               "--add-exports",
 84                               "java.base/jdk.internal.misc=ALL-UNNAMED",
 85                               mainClass);
 86         runWithArchive(cmdLine, "1");
 87         runWithArchive(cmdLine, "2");
 88         runWithArchive(cmdLine, "3");
 89     }
 90 
 91     // Same as doTest, except that LoaderConstraintsApp and MyHttpHandler* are loaded
 92     // by a custom loader. This is test case for JDK-8267347.
 93     static void doTestCustomLoader() throws Exception  {
 94         String src = " source: " + appJar;
 95         String classList[] =
 96             TestCommon.concat(loaderClasses,
 97                               "java/lang/Object id: 1",
 98                               mainClass + " id: 2 super: 1" + src,
< prev index next >