test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
open Cdiff test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java
test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/BootAppendTests.java
Print this page
rev 49650 : [mq]: module_path
*** 1,7 ****
/*
! * Copyright (c) 2015, 2017, 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.
--- 1,7 ----
/*
! * 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 ****
// 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);
}
// Test #4: A shared class in excluded package that's archived from
// -Xbootclasspath/a
! // - should be loaded from the archive by the bootstrap classloader
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);
! if (!TestCommon.isUnableToMap(output))
! output.shouldContain("[class,load] sun.nio.cs.ext.MyClass source: shared objects file");
}
// Test #5: A class not in package defined in boot module
// - should be loaded from the -Xbootclasspath/a without AppCDS
--- 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 {
! TestCommon.run(
! "-Xbootclasspath/a:" + bootAppendJar, "-cp", appJar,
! "-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 jar since AppCDS will be disabled with
! // the --limit-modules option
public static void testBootAppendExcludedModuleClassWithAppCDS() throws Exception {
! TestCommon.run(
! "-cp", appJar, "-Xbootclasspath/a:" + bootAppendJar,
! "-Xlog:class+load=info",
"--limit-modules", "java.base",
MAIN_CLASS,
! "Test #4", BOOT_APPEND_MODULE_CLASS, "true", "BOOT")
! .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 ****
// 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);
}
// 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",
"--limit-modules", "java.base",
! MAIN_CLASS,
! "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");
}
}
--- 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 {
! TestCommon.run(
! "-Xbootclasspath/a:" + bootAppendJar, "-cp", appJar,
! "-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 {
! TestCommon.run(
! "-cp", appJar, "-Xbootclasspath/a:" + bootAppendJar,
! "-Xlog:class+load=info",
"--limit-modules", "java.base",
! MAIN_CLASS, "Test #10", APP_MODULE_CLASS, "true", "BOOT")
! .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