test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
open Cdiff test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java
test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java
Print this page
*** 32,42 ****
*/
import jdk.test.lib.cds.CDSOptions;
import jdk.test.lib.cds.CDSTestUtils;
import jdk.test.lib.process.OutputAnalyzer;
- import jdk.test.lib.process.ProcessTools;
public class NonBootLoaderClasses {
public static void main(String[] args) throws Exception {
final String PLATFORM_CLASS = "jdk/dynalink/DynamicLinker";
final String APP_CLASS = "com/sun/tools/javac/Main";
--- 32,41 ----
*** 48,65 ****
.addPrefix("-XX:ExtraSharedClassListFile=" + classList, "-cp", "\"\"")
.setArchiveName(archiveName);
CDSTestUtils.createArchiveAndCheck(opts);
// Print the shared dictionary and inspect the output
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
! "-cp", "\"\"",
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
"-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary");
! OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "print-shared-archive");
! CDSTestUtils.checkMappingFailure(out);
!
! out.shouldContain("archive is valid")
! .shouldHaveExitValue(0) // Should report success in error code.
! .shouldContain(PLATFORM_CLASS.replace('/', '.'))
! .shouldContain(APP_CLASS.replace('/', '.'));
}
}
--- 47,64 ----
.addPrefix("-XX:ExtraSharedClassListFile=" + classList, "-cp", "\"\"")
.setArchiveName(archiveName);
CDSTestUtils.createArchiveAndCheck(opts);
// Print the shared dictionary and inspect the output
! opts = (new CDSOptions())
! .setUseVersion(false)
! .addSuffix( "-cp", "\"\"",
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
"-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary");
! CDSTestUtils.run(opts)
! .assertNormalExit(output -> {
! output.shouldContain("archive is valid");
! output.shouldContain(PLATFORM_CLASS.replace('/', '.'));
! output.shouldContain(APP_CLASS.replace('/', '.'));
! });
}
}
test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File