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 Mon Apr 2 14:11:59 2018
--- new/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java Mon Apr 2 14:11:59 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.
*** 145,175 ****
--- 145,181 ----
// 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,
+ "-Xlog:class+load=info",
"--limit-modules", "java.base")
.setArchiveName(testArchiveName)
+ .setUseVersion(false)
.addSuffix(MAIN_CLASS, "Test #3", BOOT_APPEND_MODULE_CLASS, "true", "BOOT");
! CDSTestUtils.runWithArchiveAndCheck(opts);
! OutputAnalyzer output = CDSTestUtils.runWithArchive(opts);
+ output.shouldHaveExitValue(0);
+ if (!TestCommon.isUnableToMap(output))
+ output.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,
"--limit-modules", "java.base",
"-XX:+TraceClassLoading",
MAIN_CLASS,
"Test #4", BOOT_APPEND_MODULE_CLASS, "true", "BOOT");
! TestCommon.checkExec(output);
! output.shouldHaveExitValue(0);
if (!TestCommon.isUnableToMap(output))
! output.shouldContain("[class,load] sun.nio.cs.ext.MyClass source: shared objects file");
! output.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
*** 229,243 ****
--- 235,254 ----
public static void testBootAppendAppExcludeModuleClassWithoutAppCDS()
throws Exception {
CDSOptions opts = (new CDSOptions())
.addPrefix("-Xbootclasspath/a:" + bootAppendJar, "-cp", appJar,
+ "-Xlog:class+load=info",
"--limit-modules", "java.base")
.setArchiveName(testArchiveName)
+ .setUseVersion(false)
.addSuffix(MAIN_CLASS, "Test #9", APP_MODULE_CLASS, "true", "BOOT");
! CDSTestUtils.runWithArchiveAndCheck(opts);
! OutputAnalyzer output = CDSTestUtils.runWithArchive(opts);
+ output.shouldHaveExitValue(0);
+ if (!TestCommon.isUnableToMap(output))
+ output.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 {
*** 246,256 ****
--- 257,267 ----
"-Xbootclasspath/a:" + bootAppendJar,
"-XX:+TraceClassLoading",
"--limit-modules", "java.base",
MAIN_CLASS,
"Test #10", APP_MODULE_CLASS, "true", "BOOT");
TestCommon.checkExec(output);
+ output.shouldHaveExitValue(0);
if (!TestCommon.isUnableToMap(output))
! output.shouldContain("[class,load] com.sun.tools.javac.Main2 source: shared objects file");
! output.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