test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/HelloDynamic.java
changeset 58447 319173c62caa
parent 57567 b000362a89a0
child 58679 9c3209ff7550
equal deleted inserted replaced
58446:5c83830390ba 58447:319173c62caa
    50         String baseArchiveName = getNewArchiveName("base");
    50         String baseArchiveName = getNewArchiveName("base");
    51         dumpBaseArchive(baseArchiveName);
    51         dumpBaseArchive(baseArchiveName);
    52         doTest(baseArchiveName, topArchiveName);
    52         doTest(baseArchiveName, topArchiveName);
    53     }
    53     }
    54 
    54 
       
    55     private static final String JDWP_OPTION =
       
    56         "-Xrunjdwp:transport=dt_socket,server=y,suspend=n";
       
    57 
    55     private static void doTest(String baseArchiveName, String topArchiveName) throws Exception {
    58     private static void doTest(String baseArchiveName, String topArchiveName) throws Exception {
    56         String appJar = ClassFileInstaller.getJarPath("hello.jar");
    59         String appJar = ClassFileInstaller.getJarPath("hello.jar");
    57         String mainClass = "Hello";
    60         String mainClass = "Hello";
    58         dump2(baseArchiveName, topArchiveName,
    61         dump2(baseArchiveName, topArchiveName,
    59              "-Xlog:cds",
    62              "-Xlog:cds",
    69             "-cp", appJar, mainClass)
    72             "-cp", appJar, mainClass)
    70             .assertNormalExit(output -> {
    73             .assertNormalExit(output -> {
    71                     output.shouldContain("Hello source: shared objects file")
    74                     output.shouldContain("Hello source: shared objects file")
    72                           .shouldHaveExitValue(0);
    75                           .shouldHaveExitValue(0);
    73                 });
    76                 });
       
    77 
       
    78         // Sanity test with JDWP options.
       
    79         // Test with the default base archive should be sufficient.
       
    80         if (baseArchiveName == null) {
       
    81             run2(baseArchiveName, topArchiveName,
       
    82                 JDWP_OPTION,
       
    83                 "-Xlog:class+load",
       
    84                 "-Xlog:cds+dynamic=debug,cds=debug",
       
    85                 "-cp", appJar, mainClass)
       
    86                 .assertNormalExit(output -> {
       
    87                     output.shouldContain("Hello source: shared objects file")
       
    88                           .shouldHaveExitValue(0);
       
    89                     });
       
    90         }
    74     }
    91     }
    75 }
    92 }