diff -r ac11b83e0f38 -r d8eddc0ba770 test/hotspot/jtreg/runtime/cds/appcds/javaldr/AnonVmClassesDuringDump.java --- a/test/hotspot/jtreg/runtime/cds/appcds/javaldr/AnonVmClassesDuringDump.java Mon Nov 18 13:22:27 2019 +0100 +++ b/test/hotspot/jtreg/runtime/cds/appcds/javaldr/AnonVmClassesDuringDump.java Mon Nov 18 14:13:11 2019 -0800 @@ -32,16 +32,15 @@ * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes * @requires vm.cds * @requires vm.flavor != "minimal" - * @build AnonVmClassesDuringDumpTransformer Hello - * @run main/othervm AnonVmClassesDuringDump + * @run driver AnonVmClassesDuringDump */ public class AnonVmClassesDuringDump { public static String appClasses[] = { - "Hello", + Hello.class.getName(), }; public static String agentClasses[] = { - "AnonVmClassesDuringDumpTransformer", + AnonVmClassesDuringDumpTransformer.class.getName(), }; public static String cdsDiagnosticOption = "-XX:+AllowArchivingWithJavaAgent"; @@ -55,7 +54,7 @@ String appJar = ClassFileInstaller.writeJar("AnonVmClassesDuringDumpApp.jar", appClasses); - TestCommon.testDump(appJar, TestCommon.list("Hello"), + TestCommon.testDump(appJar, TestCommon.list(Hello.class.getName()), "-javaagent:" + agentJar, "-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption, // Set the following property to see logs for dynamically generated classes @@ -71,13 +70,13 @@ String pattern = prefix + class_pattern + suffix; // during run time, anonymous classes shouldn't be loaded from the archive TestCommon.run("-cp", appJar, - "-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption, "Hello") + "-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption, Hello.class.getName()) .assertNormalExit(output -> output.shouldNotMatch(pattern)); // inspect the archive and make sure no anonymous class is in there TestCommon.run("-cp", appJar, "-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption, - "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary", "Hello") + "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary", Hello.class.getName()) .assertNormalExit(output -> output.shouldNotMatch(class_pattern)); } }