RFR 8212045: Add back tests removed from HashesTest.java and AddExportsTest.java
Roger Riggs
Roger.Riggs at oracle.com
Thu Oct 11 14:09:20 UTC 2018
Look fine Lance.
On 10/11/2018 07:55 AM, Lance Andersen wrote:
> Hi all,,
>
> Catching up on this issue from my todo list which adds a test back to HashesTest.java and AddExportsTest.java which were removed as part of the Java EE module removal(The original changes to remove the tests can be found at: http://cr.openjdk.java.net/~lancea/8190378/open_changes/tests_webrev/ <http://cr.openjdk.java.net/~lancea/8190378/open_changes/tests_webrev/>)
>
>
> The webrev can be found for the change at http://cr.openjdk.java.net/~lancea/8212045/webrev.00/index.html <http://cr.openjdk.java.net/~lancea/8212045/webrev.00/index.html>
>
>
> To help make the review easier, here is a diff of the tests comparing the new changes to the tests prior to the Java EE module removal:
>
> ————
> HashesTest.java diff
> ——————
> $ hg diff -r 47216 test/jdk/tools/jmod/hashes/HashesTest.java
> diff -r 71c04702a3d5 test/jdk/tools/jmod/hashes/HashesTest.java
> --- a/test/jdk/tools/jmod/hashes/HashesTest.java Tue Sep 12 19:03:39 2017 +0200
> +++ b/test/jdk/tools/jmod/hashes/HashesTest.java Thu Jun 14 12:34:52 2018 -0400
> @@ -1,5 +1,5 @@
> /**
> - * 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
> @@ -247,19 +247,17 @@
> Path dest = Paths.get("test4");
> HashesTest ht = new HashesTest(dest);
> ht.makeModule("m1");
> - ht.makeModule("java.xml.bind", "m1");
> - ht.makeModule("java.xml.ws", "java.xml.bind");
> - ht.makeModule("m2", "java.xml.ws");
> + ht.makeModule("java.compiler", "m1");
> + ht.makeModule("m2", "java.compiler");
>
> ht.makeJmod("m1");
> ht.makeJmod("m2");
> - ht.makeJmod("java.xml.ws");
> - ht.makeJmod("java.xml.bind",
> + ht.makeJmod("java.compiler",
> "--module-path",
> ht.lib.toString() + File.pathSeparator + mpath,
> - "--hash-modules", "^java.xml.*|^m.*");
> + "--hash-modules", "java\\.(?!se)|^m.*");
>
> - ht.checkHashes("java.xml.bind", "java.xml.ws", "m2");
> + ht.checkHashes("java.compiler", "m2");
> }
>
> @Test
>
> —————————
>
> AddExports.java Diff
>
> ———————
> $ hg diff -r 47216 test/jdk/tools/launcher/modules/addexports/AddExportsTest.java
> diff -r 71c04702a3d5 test/jdk/tools/launcher/modules/addexports/AddExportsTest.java
> --- a/test/jdk/tools/launcher/modules/addexports/AddExportsTest.java Tue Sep 12 19:03:39 2017 +0200
> +++ b/test/jdk/tools/launcher/modules/addexports/AddExportsTest.java Fri Jun 15 15:17:56 2018 -0400
> @@ -24,7 +24,7 @@
> /**
> * @test
> * @library /lib/testlibrary /test/lib
> - * @modules java.transaction
> + * @modules java.compiler
> * jdk.compiler
> * @build AddExportsTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
> * @run testng AddExportsTest
> @@ -58,7 +58,7 @@
> private static final String TEST1_MODULE = "m1";
> private static final String TEST1_MAIN_CLASS = "jdk.test1.Main";
>
> - // test module m2 uses java.transaction internals
> + // test module m2 uses java.compiler internals
> private static final String TEST2_MODULE = "m2";
> private static final String TEST2_MAIN_CLASS = "jdk.test2.Main";
>
> @@ -78,18 +78,18 @@
> "--add-exports", "java.base/jdk.internal.misc=m1");
> assertTrue(compiled, "module " + TEST1_MODULE + " did not compile");
>
> - // javac -d upgrademods/java.transaction src/java.transaction/**
> + // javac -d upgrademods/java.compiler src/java.compiler/**
> compiled = CompilerUtils.compile(
> - SRC_DIR.resolve("java.transaction"),
> - UPGRADE_MODS_DIRS.resolve("java.transaction"));
> - assertTrue(compiled, "module java.transaction did not compile");
> + SRC_DIR.resolve("java.compiler"),
> + UPGRADE_MODS_DIRS.resolve("java.compiler"));
> + assertTrue(compiled, "module java.compiler did not compile");
>
> // javac --upgrade-module-path upgrademods -d mods/m2 src/m2/**
> compiled = CompilerUtils.compile(
> SRC_DIR.resolve(TEST2_MODULE),
> MODS_DIR.resolve(TEST2_MODULE),
> "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(),
> - "--add-exports", "java.transaction/javax.transaction.internal=m2");
> + "--add-exports", "java.compiler/javax.tools.internal=m2");
> assertTrue(compiled, "module " + TEST2_MODULE + " did not compile");
>
> // javac -d mods/m3 src/m3/**
> @@ -168,11 +168,11 @@
> */
> public void testWithUpgradedModule() throws Exception {
>
> - // java --add-exports java.transaction/javax.transaction.internal=m2
> + // java --add-exports java.compiler/javax.tools.internal=m2
> // --upgrade-module-path upgrademods --module-path mods -m ...
> String mid = TEST2_MODULE + "/" + TEST2_MAIN_CLASS;
> int exitValue = executeTestJava(
> - "--add-exports", "java.transaction/javax.transaction.internal=m2",
> + "--add-exports", "java.compiler/javax.tools.internal=m2",
> "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(),
> "--module-path", MODS_DIR.toString(),
> "-m", mid)
> ljanders-mac:open ljanders$
>
> --------------------
>
> The mach 5 jdk tier1, tier2, and tier3 tests ran without error
>
> Best
> Lance
> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
> <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
> <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering
> 1 Network Drive
> Burlington, MA 01803
> Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>
>
>
>
--
Thanks, Roger
More information about the core-libs-dev
mailing list