< prev index next >

test/jdk/tools/launcher/modules/addexports/AddExportsTest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2014, 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) 2014, 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.
*** 22,33 **** */ /** * @test * @library /lib/testlibrary /test/lib ! * @modules java.transaction ! * jdk.compiler * @build AddExportsTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @run testng AddExportsTest * @summary Basic tests for java --add-exports */ --- 22,32 ---- */ /** * @test * @library /lib/testlibrary /test/lib ! * @modules jdk.compiler * @build AddExportsTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @run testng AddExportsTest * @summary Basic tests for java --add-exports */
*** 50,68 **** private static final String TEST_SRC = System.getProperty("test.src"); private static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); private static final Path MODS_DIR = Paths.get("mods"); - private static final Path UPGRADE_MODS_DIRS = Paths.get("upgrademods"); // test module m1 that uses Unsafe private static final String TEST1_MODULE = "m1"; private static final String TEST1_MAIN_CLASS = "jdk.test1.Main"; ! // test module m2 uses java.transaction internals ! private static final String TEST2_MODULE = "m2"; ! private static final String TEST2_MAIN_CLASS = "jdk.test2.Main"; // test module m3 uses m4 internals private static final String TEST3_MODULE = "m3"; private static final String TEST3_MAIN_CLASS = "jdk.test3.Main"; private static final String TEST4_MODULE = "m4"; --- 49,64 ---- private static final String TEST_SRC = System.getProperty("test.src"); private static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); private static final Path MODS_DIR = Paths.get("mods"); // test module m1 that uses Unsafe private static final String TEST1_MODULE = "m1"; private static final String TEST1_MAIN_CLASS = "jdk.test1.Main"; ! // test module m3 uses m4 internals private static final String TEST3_MODULE = "m3"; private static final String TEST3_MAIN_CLASS = "jdk.test3.Main"; private static final String TEST4_MODULE = "m4";
*** 76,98 **** SRC_DIR.resolve(TEST1_MODULE), MODS_DIR.resolve(TEST1_MODULE), "--add-exports", "java.base/jdk.internal.misc=m1"); assertTrue(compiled, "module " + TEST1_MODULE + " did not compile"); - // javac -d upgrademods/java.transaction src/java.transaction/** - compiled = CompilerUtils.compile( - SRC_DIR.resolve("java.transaction"), - UPGRADE_MODS_DIRS.resolve("java.transaction")); - assertTrue(compiled, "module java.transaction 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"); - assertTrue(compiled, "module " + TEST2_MODULE + " did not compile"); // javac -d mods/m3 src/m3/** compiled = CompilerUtils.compile( SRC_DIR.resolve(TEST3_MODULE), MODS_DIR.resolve(TEST3_MODULE)); --- 72,82 ----
*** 161,190 **** assertTrue(exitValue == 0); } - /** - * Test --add-exports with upgraded module - */ - public void testWithUpgradedModule() throws Exception { - - // java --add-exports java.transaction/javax.transaction.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", - "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(), - "--module-path", MODS_DIR.toString(), - "-m", mid) - .outputTo(System.out) - .errorTo(System.out) - .getExitValue(); - - assertTrue(exitValue == 0); - } - /** * Test --add-exports with module that is added to the set of root modules * with --add-modules. */ --- 145,154 ----
< prev index next >