Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,32 +218,5 @@ private static void doTest(String baseArchiveName, String topArchiveName) throws
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");
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,30 @@ private static void doTest(String baseArchiveName, String topArchiveName) throws
"-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);
});
}
}

{
Expand Down