< prev index next >
test/hotspot/jtreg/runtime/cds/appcds/javaldr/AnonVmClassesDuringDump.java
Print this page
rev 59477 : [mq]: cds_lambda
*** 43,52 ****
--- 43,55 ----
AnonVmClassesDuringDumpTransformer.class.getName(),
};
public static String cdsDiagnosticOption = "-XX:+AllowArchivingWithJavaAgent";
+ public static final boolean dynamicMode =
+ Boolean.getBoolean(System.getProperty("test.dynamic.cds.archive", "false"));
+
public static void main(String[] args) throws Throwable {
String agentJar =
ClassFileInstaller.writeJar("AnonVmClassesDuringDumpTransformer.jar",
ClassFileInstaller.Manifest.fromSourceFile("AnonVmClassesDuringDumpTransformer.mf"),
agentClasses);
*** 69,83 ****
String suffix = ".*source: shared objects file.*";
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.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.class.getName())
! .assertNormalExit(output -> output.shouldNotMatch(class_pattern));
}
}
--- 72,90 ----
String suffix = ".*source: shared objects file.*";
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.class.getName())
! .assertNormalExit(dynamicMode ?
! output -> output.shouldMatch(pattern) :
! 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.class.getName())
! .assertNormalExit(dynamicMode ?
! output -> output.shouldMatch(pattern) :
! output -> output.shouldNotMatch(pattern));
}
}
< prev index next >