8224548: [TESTBUG] runtime/appcds/jvmti/ClassFileLoadHookTest.java failed: must be shared
Improve the -Xshare:auto case Reviewed-by: iklam, coleenp
This commit is contained in:
parent
e4325bfd90
commit
421c364797
@ -95,9 +95,25 @@ public class ClassFileLoadHook {
|
|||||||
|
|
||||||
switch (testCase) {
|
switch (testCase) {
|
||||||
case SHARING_ON_CFLH_OFF:
|
case SHARING_ON_CFLH_OFF:
|
||||||
case SHARING_AUTO_CFLH_ON:
|
|
||||||
case SHARING_ON_CFLH_ON:
|
case SHARING_ON_CFLH_ON:
|
||||||
assertTrue(wb.isSharedClass(c), "must be shared");
|
assertTrue(wb.isSharedClass(c), "must be shared");
|
||||||
|
break;
|
||||||
|
case SHARING_AUTO_CFLH_ON:
|
||||||
|
// With -Xshare:auto, the test continues to run with mapping failure.
|
||||||
|
// In case of mapping failure, java/lang/Object and the app class
|
||||||
|
// won't be loaded from the archive.
|
||||||
|
Class objClass = Class.forName("java.lang.Object");
|
||||||
|
if (wb.isSharedClass(objClass)) {
|
||||||
|
assertTrue(wb.isSharedClass(c), "must be shared");
|
||||||
|
} else {
|
||||||
|
assertFalse(wb.isSharedClass(c), "must not be shared");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// this test is not applicable to -Xshare:off
|
||||||
|
if (testCase != TestCaseId.SHARING_OFF_CFLH_ON) {
|
||||||
|
throw new RuntimeException("Invalid testcase");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import jdk.test.lib.Asserts;
|
|
||||||
import jdk.test.lib.cds.CDSOptions;
|
import jdk.test.lib.cds.CDSOptions;
|
||||||
import jdk.test.lib.process.OutputAnalyzer;
|
import jdk.test.lib.process.OutputAnalyzer;
|
||||||
import jdk.test.lib.process.ProcessTools;
|
import jdk.test.lib.process.ProcessTools;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user