< prev index next > test/hotspot/jtreg/runtime/cds/appcds/jigsaw/module/ModuleOption.java
Print this page
final String loggingOption = "-Xlog:aot=debug,aot+module=debug,aot+heap=info,cds=debug,module=trace";
// Pattern of a module version string.
// e.g. JDK 22: "java 22"
// JDK 22.0.1: "java 22.0.1"
final String versionPattern = "java.[0-9][0-9].*";
+ final String noOptimizedModuleHandling = "optimized module handling: disabled because archive was created without optimized module handling";
String archiveName = TestCommon.getNewArchiveName("module-option");
TestCommon.setCurrentArchiveName(archiveName);
// dump a base archive with -m jdk.httpserver
OutputAnalyzer oa = TestCommon.dumpBaseArchive(
loggingOption,
"-m", moduleOption,
"-version");
oa.shouldHaveExitValue(0)
// version of the jdk.httpserver module, e.g. java 22-ea
! .shouldMatch(versionPattern)
! .shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.httpserver");
// different module specified during runtime
oa = TestCommon.execCommon(
loggingOption,
"-m", "jdk.compiler/com.sun.tools.javac.Main",
loggingOption,
"-m", moduleOption,
"-version");
oa.shouldHaveExitValue(0)
// version of the jdk.httpserver module, e.g. java 22-ea
! .shouldMatch(versionPattern);
! if (!oa.contains(noOptimizedModuleHandling)) {
+ oa.shouldMatch("aot,module.*Restored from archive: entry.0x.*name jdk.httpserver");
+ }
// different module specified during runtime
oa = TestCommon.execCommon(
loggingOption,
"-m", "jdk.compiler/com.sun.tools.javac.Main",
< prev index next >