test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java Fri Apr 6 15:48:25 2018
--- new/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java Fri Apr 6 15:48:24 2018
*** 1,7 ****
--- 1,7 ----
/*
! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
! * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 143,175 ****
--- 143,178 ----
// Test #3: A class in excluded package defined in boot module
// - should be loaded from the -Xbootclasspath/a by the boot classloader
public static void testBootAppendExcludedModuleClassWithoutAppCDS() throws Exception {
CDSOptions opts = (new CDSOptions())
- .addPrefix("-Xbootclasspath/a:" + bootAppendJar, "-cp", appJar,
"--limit-modules", "java.base")
.setArchiveName(testArchiveName)
.addSuffix(MAIN_CLASS, "Test #3", BOOT_APPEND_MODULE_CLASS, "true", "BOOT");
CDSTestUtils.runWithArchiveAndCheck(opts);
+ TestCommon.run(
+ "-Xlog:class+load=info",
+ "--limit-modules", "java.base",
+ MAIN_CLASS, "Test #3", BOOT_APPEND_MODULE_CLASS, "true", "BOOT")
+ .assertSilentlyDisabledCDS(out -> {
+ out.shouldHaveExitValue(0)
+ .shouldMatch(".class.load. sun.nio.cs.ext.MyClass source:.*bootAppend.jar");
+ });
}
// Test #4: A shared class in excluded package that's archived from
// -Xbootclasspath/a
! // - should be loaded from the archive by the bootstrap classloader
! // - should be loaded from the jar since AppCDS will be disabled with
+ // the --limit-modules option
public static void testBootAppendExcludedModuleClassWithAppCDS() throws Exception {
! OutputAnalyzer output = TestCommon.exec(
! appJar,
! "-Xbootclasspath/a:" + bootAppendJar,
! TestCommon.run(
! "-cp", appJar, "-Xbootclasspath/a:" + bootAppendJar,
! "-Xlog:class+load=info",
"--limit-modules", "java.base",
"-XX:+TraceClassLoading",
MAIN_CLASS,
- "Test #4", BOOT_APPEND_MODULE_CLASS, "true", "BOOT");
TestCommon.checkExec(output);
! if (!TestCommon.isUnableToMap(output))
! output.shouldContain("[class,load] sun.nio.cs.ext.MyClass source: shared objects file");
+ .assertSilentlyDisabledCDS(out -> {
! out.shouldHaveExitValue(0)
! .shouldMatch(".class.load. sun.nio.cs.ext.MyClass source:.*bootAppend.jar");
+ });
}
// Test #5: A class not in package defined in boot module
// - should be loaded from the -Xbootclasspath/a without AppCDS
*** 227,256 ****
--- 230,259 ----
// Test #9: A class in excluded package defined in jimage app module
// - should be loaded from the -Xbootclasspath/a without AppCDS
public static void testBootAppendAppExcludeModuleClassWithoutAppCDS()
throws Exception {
CDSOptions opts = (new CDSOptions())
- .addPrefix("-Xbootclasspath/a:" + bootAppendJar, "-cp", appJar,
"--limit-modules", "java.base")
.setArchiveName(testArchiveName)
.addSuffix(MAIN_CLASS, "Test #9", APP_MODULE_CLASS, "true", "BOOT");
CDSTestUtils.runWithArchiveAndCheck(opts);
+ TestCommon.run(
+ "-Xlog:class+load=info",
+ "--limit-modules", "java.base",
+ MAIN_CLASS, "Test #9", APP_MODULE_CLASS, "true", "BOOT")
+ .assertSilentlyDisabledCDS(out -> {
+ out.shouldHaveExitValue(0)
+ .shouldMatch(".class.load. com.sun.tools.javac.Main2 source:.*bootAppend.jar");
+ });
}
// Test #10: A shared class in excluded package defined in jimage app module
// - should be loaded from the -Xbootclasspath/a with AppCDS
public static void testBootAppendAppExcludeModuleClassAppCDS() throws Exception {
! OutputAnalyzer output = TestCommon.exec(
! appJar,
! "-Xbootclasspath/a:" + bootAppendJar,
"-XX:+TraceClassLoading",
! TestCommon.run(
! "-cp", appJar, "-Xbootclasspath/a:" + bootAppendJar,
! "-Xlog:class+load=info",
"--limit-modules", "java.base",
! MAIN_CLASS, "Test #10", APP_MODULE_CLASS, "true", "BOOT")
"Test #10", APP_MODULE_CLASS, "true", "BOOT");
TestCommon.checkExec(output);
if (!TestCommon.isUnableToMap(output))
output.shouldContain("[class,load] com.sun.tools.javac.Main2 source: shared objects file");
+ .assertSilentlyDisabledCDS(out -> {
+ out.shouldHaveExitValue(0)
+ .shouldMatch(".class.load. com.sun.tools.javac.Main2 source:.*bootAppend.jar");
+ });
}
}
test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File