8281715: Move "base CDS archive not loaded" tests to SharedArchiveFileOption.java
Reviewed-by: ccheung, iklam
This commit is contained in:
parent
29b8242e07
commit
a667213ec5
@ -218,32 +218,5 @@ public class ArchiveConsistency extends DynamicArchiveTestBase {
|
||||
runTwo(nonExistBase, nonExistTop,
|
||||
appJar, mainClass, isAuto ? 0 : 1,
|
||||
"Specified shared archive not found (" + nonExistBase + ")");
|
||||
|
||||
// following two tests:
|
||||
// -Xshare:auto -XX:SharedArchiveFile=top.jsa, but base does not exist.
|
||||
|
||||
if (!isUseSharedSpacesDisabled()) {
|
||||
new File(baseArchiveName).delete();
|
||||
|
||||
startTest("11. -XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=" + topArchiveName);
|
||||
run(topArchiveName,
|
||||
"-Xshare:auto",
|
||||
"-XX:+AutoCreateSharedArchive",
|
||||
"-cp",
|
||||
appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("warning: -XX:+AutoCreateSharedArchive is unsupported when base CDS archive is not loaded");
|
||||
});
|
||||
|
||||
startTest("12. -XX:SharedArchiveFile=" + topArchiveName + " -XX:ArchiveClassesAtExit=" + getNewArchiveName("top3"));
|
||||
run(topArchiveName,
|
||||
"-Xshare:auto",
|
||||
"-XX:ArchiveClassesAtExit=" + getNewArchiveName("top3"),
|
||||
"-cp",
|
||||
appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -228,6 +228,30 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase {
|
||||
"-Xlog:cds",
|
||||
"-cp", appJar, mainClass)
|
||||
.assertAbnormalExit("Cannot use the following option when dumping the shared archive: --patch-module");
|
||||
|
||||
// following two tests:
|
||||
// -Xshare:auto -XX:SharedArchiveFile=top.jsa, but base does not exist.
|
||||
if (!isUseSharedSpacesDisabled()) {
|
||||
new File(baseArchiveName).delete();
|
||||
testcase("Archive not loaded -XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=" + topArchiveName);
|
||||
run(topArchiveName,
|
||||
"-Xshare:auto",
|
||||
"-XX:+AutoCreateSharedArchive",
|
||||
"-cp",
|
||||
appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("warning: -XX:+AutoCreateSharedArchive is unsupported when base CDS archive is not loaded");
|
||||
});
|
||||
testcase("Archive not loaded -XX:SharedArchiveFile=" + topArchiveName + " -XX:ArchiveClassesAtExit=" + getNewArchiveName("top3"));
|
||||
run(topArchiveName,
|
||||
"-Xshare:auto",
|
||||
"-XX:ArchiveClassesAtExit=" + getNewArchiveName("top3"),
|
||||
"-cp",
|
||||
appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain(ERROR);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user