changeset 14484:b7d2a7346aa6

Minor clean-up of tests for -XaddExports
author alanb
date Sat, 14 Nov 2015 14:44:21 +0000
parents 4fd9addf4669
children 5c676ed31145
files test/jdk/jigsaw/launcher/addexports/AddExportsTest.java test/jdk/jigsaw/launcher/addexports/src/java.transaction/javax/transaction/internal/Helper.java test/jdk/jigsaw/launcher/addexports/src/java.transaction/javax/transaction/internal/InternalTransaction.java test/jdk/jigsaw/launcher/addexports/src/m1/jdk/test1/Main.java test/jdk/jigsaw/launcher/addexports/src/m1/module-info.java test/jdk/jigsaw/launcher/addexports/src/m2/jdk/test2/Main.java test/jdk/jigsaw/launcher/addexports/src/m2/module-info.java test/jdk/jigsaw/launcher/addexports/src/m3/jdk/test3/Main.java test/jdk/jigsaw/launcher/addexports/src/m3/module-info.java test/jdk/jigsaw/launcher/addexports/src/m4/jdk/test4/Type.java test/jdk/jigsaw/launcher/addexports/src/m4/module-info.java test/jdk/jigsaw/launcher/addexports/src/one.more/module-info.java test/jdk/jigsaw/launcher/addexports/src/one.more/one/internal/InternalClass.java test/jdk/jigsaw/launcher/addexports/src/one.more/one/more/OneMoreClass.java test/jdk/jigsaw/launcher/addexports/src/test/jdk/test/UsesUnsafe.java test/jdk/jigsaw/launcher/addexports/src/test/module-info.java test/jdk/jigsaw/launcher/addexports/src/testAdd/jdk/test/UsesInternalClass.java test/jdk/jigsaw/launcher/addexports/src/testAdd/module-info.java test/jdk/jigsaw/launcher/addexports/src/testUpgrade/jdk/test/UsesInternalTransaction.java test/jdk/jigsaw/launcher/addexports/src/testUpgrade/module-info.java
diffstat 20 files changed, 325 insertions(+), 351 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/jigsaw/launcher/addexports/AddExportsTest.java	Sat Nov 14 11:31:48 2015 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/AddExportsTest.java	Sat Nov 14 14:44:21 2015 +0000
@@ -48,56 +48,57 @@
 
     private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
     private static final Path MODS_DIR = Paths.get("mods");
-    private static final Path UPGRMODS_DIR = Paths.get("upgrmods");
+    private static final Path UPGRADE_MODS_DIRS = Paths.get("upgrademods");
 
-    // the module name of the test module
-    private static final String TEST_MODULE = "test";
-    private static final String TEST_MODULE_ADD = "testAdd";
-    private static final String TEST_MODULE_UPGRADE = "testUpgrade";
+    // test module m1 that uses Unsafe
+    private static final String TEST1_MODULE = "m1";
+    private static final String TEST1_MAIN_CLASS = "jdk.test1.Main";
 
-    // the module main class
-    private static final String MAIN_CLASS = "jdk.test.UsesUnsafe";
-    private static final String MAIN_CLASS_ADD = "jdk.test.UsesInternalClass";
-    private static final String MAIN_CLASS_UPGRADE = "jdk.test.UsesInternalTransaction";
+    // 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";
 
 
     @BeforeTest
-    public void compileTestModule() throws Exception {
+    public void compileTestModules() throws Exception {
 
-        // javac -d mods/$TESTMODULE src/$TESTMODULE/**
-        boolean compiled
-            = CompilerUtils.compile(SRC_DIR.resolve(TEST_MODULE),
-                                    MODS_DIR.resolve(TEST_MODULE),
-                                    "-XaddExports:java.base/sun.misc=test");
-        assertTrue(compiled, "test module did not compile");
+        // javac -d mods/m1 src/m1/**
+        boolean compiled = CompilerUtils.compile(
+                SRC_DIR.resolve(TEST1_MODULE),
+                MODS_DIR.resolve(TEST1_MODULE),
+                "-XaddExports:java.base/sun.misc=m1");
+        assertTrue(compiled, "module " + TEST1_MODULE + " did not compile");
 
-        // javac -d upgrmods/$ADDMODULE src/$ADDMODULE/**
-        compiled
-            = CompilerUtils.compile(SRC_DIR.resolve("one.more"),
-                                    MODS_DIR.resolve("one.more"));
-        assertTrue(compiled, "added 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 -d mods/$TESTADD src/$TESTADD/**
-        compiled
-            = CompilerUtils.compile(SRC_DIR.resolve(TEST_MODULE_ADD),
-                                    MODS_DIR.resolve(TEST_MODULE_ADD),
-                                    "-mp", MODS_DIR.toString(),
-                                    "-XaddExports:one.more/one.internal=testAdd");
-        assertTrue(compiled, "test add module did not compile");
+        // javac -upgrademodulepath upgrademods -d mods/m2 src/m2/**
+        compiled = CompilerUtils.compile(
+                SRC_DIR.resolve(TEST2_MODULE),
+                MODS_DIR.resolve(TEST2_MODULE),
+                "-upgrademodulepath", UPGRADE_MODS_DIRS.toString(),
+                "-XaddExports:java.transaction/javax.transaction.internal=m2");
+        assertTrue(compiled, "module " + TEST2_MODULE + " did not compile");
 
-        // javac -d upgrmods/$UPGRMODULE src/$UPGRMODULE/**
-        compiled
-            = CompilerUtils.compile(SRC_DIR.resolve("java.transaction"),
-                                    UPGRMODS_DIR.resolve("java.transaction"));
-        assertTrue(compiled, "upgraded module did not compile");
+        // javac -d mods/m3 src/m3/**
+        compiled = CompilerUtils.compile(
+                SRC_DIR.resolve(TEST3_MODULE),
+                MODS_DIR.resolve(TEST3_MODULE));
+        assertTrue(compiled, "module " + TEST3_MODULE + " did not compile");
 
-        // javac -d mods/$TESTUPGRADE src/$TESTUPGRADE/**
-        compiled
-            = CompilerUtils.compile(SRC_DIR.resolve(TEST_MODULE_UPGRADE),
-                                    MODS_DIR.resolve(TEST_MODULE_UPGRADE),
-                                    "-upgrademodulepath", UPGRMODS_DIR.toString(),
-                                    "-XaddExports:java.transaction/javax.transaction.internal=testUpgrade");
-        assertTrue(compiled, "test upgrade module did not compile");
+        // javac -d mods/m4 src/m4/**
+        compiled = CompilerUtils.compile(
+                SRC_DIR.resolve(TEST4_MODULE),
+                MODS_DIR.resolve(TEST4_MODULE));
+        assertTrue(compiled, "module " + TEST4_MODULE + " did not compile");
     }
 
     /**
@@ -124,11 +125,11 @@
         // java -XaddExports:java.base/sun.misc=ALL-UNNAMED \
         //      -cp mods/$TESTMODULE jdk.test.UsesUnsafe
 
-        String classpath = MODS_DIR.resolve(TEST_MODULE).toString();
+        String classpath = MODS_DIR.resolve(TEST1_MODULE).toString();
         int exitValue
             = executeTestJava("-XaddExports:java.base/sun.misc=ALL-UNNAMED",
                               "-cp", classpath,
-                              MAIN_CLASS)
+                              TEST1_MAIN_CLASS)
                 .outputTo(System.out)
                 .errorTo(System.out)
                 .getExitValue();
@@ -145,9 +146,9 @@
         //  java -XaddExports:java.base/sun.misc=test \
         //       -mp mods -m $TESTMODULE/$MAIN_CLASS
 
-        String mid = TEST_MODULE + "/" + MAIN_CLASS;
+        String mid = TEST1_MODULE + "/" + TEST1_MAIN_CLASS;
         int exitValue =
-            executeTestJava("-XaddExports:java.base/sun.misc=" + TEST_MODULE,
+            executeTestJava("-XaddExports:java.base/sun.misc=" + TEST1_MODULE,
                             "-mp", MODS_DIR.toString(),
                             "-m", mid)
                 .outputTo(System.out)
@@ -157,20 +158,20 @@
         assertTrue(exitValue == 0);
     }
 
+
     /**
-     * Run added modules with -XaddExports
+     * Test -XaddExports with upgraded module
      */
-    public void testAdddedModule() throws Exception {
+    public void testWithUpgradedModule() throws Exception {
 
-        // java -XaddExports:one.more/one.internal=testAdd
-        // -mp mods -addmods one.more -m testAdd/jdk.test.UsesInternalClas
-
-        String mid = TEST_MODULE_ADD + "/" + MAIN_CLASS_ADD;
-        int exitValue =
-            executeTestJava("-XaddExports:one.more/one.internal=testAdd",
-                            "-mp", MODS_DIR.toString(),
-                            "-addmods", "one.more",
-                            "-m", mid)
+        // java -XaddExports:java.transaction/javax.transaction.internal=m2
+        //      -upgrademodulepath upgrademods -mp mods -m ...
+        String mid = TEST2_MODULE + "/" + TEST2_MAIN_CLASS;
+        int exitValue = executeTestJava(
+                "-XaddExports:java.transaction/javax.transaction.internal=m2",
+                "-upgrademodulepath", UPGRADE_MODS_DIRS.toString(),
+                "-mp", MODS_DIR.toString(),
+                "-m", mid)
                 .outputTo(System.out)
                 .errorTo(System.out)
                 .getExitValue();
@@ -178,20 +179,20 @@
         assertTrue(exitValue == 0);
     }
 
+
     /**
-     * Run upgraded modules with -XaddExports
+     * Test -XaddExports with module that is added to the set of root modules
+     * with -addmods.
      */
-    public void testUpgradedModule() throws Exception {
+    public void testWithAddMods() throws Exception {
 
-        // java -upgrademodulepath upgrmods -mp mods
-        // -m testUpgrade/jdk.test.UsesInternalTransaction
-
-        String mid = TEST_MODULE_UPGRADE + "/" + MAIN_CLASS_UPGRADE;
-        int exitValue =
-            executeTestJava("-XaddExports:java.transaction/javax.transaction.internal=testUpgrade",
-                            "-upgrademodulepath", UPGRMODS_DIR.toString(),
-                            "-mp", MODS_DIR.toString(),
-                            "-m", mid)
+        // java -XaddExports:m4/jdk.test4=m3 -mp mods -m ...
+        String mid = TEST3_MODULE + "/" + TEST3_MAIN_CLASS;
+        int exitValue = executeTestJava(
+                "-XaddExports:m4/jdk.test4=m3",
+                "-mp", MODS_DIR.toString(),
+                "-addmods", TEST4_MODULE,
+                "-m", mid)
                 .outputTo(System.out)
                 .errorTo(System.out)
                 .getExitValue();
@@ -199,6 +200,7 @@
         assertTrue(exitValue == 0);
     }
 
+
     /**
      * -XaddExports can only be specified once
      */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/java.transaction/javax/transaction/internal/Helper.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.transaction.internal;
+
+public class Helper {
+}
--- a/test/jdk/jigsaw/launcher/addexports/src/java.transaction/javax/transaction/internal/InternalTransaction.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.transaction.internal;
-
-public class InternalTransaction {
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m1/jdk/test1/Main.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2014, 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test1;
+
+import java.lang.reflect.Field;
+import sun.misc.Unsafe;
+
+public class Main {
+    public static void main(String[] args) throws Exception {
+        Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
+        theUnsafe.setAccessible(true);
+        Unsafe unsafe = (Unsafe) theUnsafe.get(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m1/module-info.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2014, 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m1 {
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m2/jdk/test2/Main.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test2;
+
+import javax.transaction.internal.Helper;
+
+public class Main {
+    public static void main(String[] args) {
+        Helper h = new Helper();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m2/module-info.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m2 {
+    requires java.transaction;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m3/jdk/test3/Main.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test3;
+
+public class Main {
+    public static void main(String[] args) throws Exception {
+        Class<?> c = Class.forName("jdk.test4.Type");
+        Main.class.getModule().addReads(c.getModule());
+        Object o = c.newInstance();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m3/module-info.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m3 {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m4/jdk/test4/Type.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test4;
+
+public class Type {
+    public Type() { }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jigsaw/launcher/addexports/src/m4/module-info.java	Sat Nov 14 14:44:21 2015 +0000
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2015, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m4 {
+}
--- a/test/jdk/jigsaw/launcher/addexports/src/one.more/module-info.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-module one.more {
-    exports one.more;
-}
--- a/test/jdk/jigsaw/launcher/addexports/src/one.more/one/internal/InternalClass.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package one.internal;
-
-public class InternalClass {
-}
--- a/test/jdk/jigsaw/launcher/addexports/src/one.more/one/more/OneMoreClass.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package one.more;
-
-public class OneMoreClass {
-}
--- a/test/jdk/jigsaw/launcher/addexports/src/test/jdk/test/UsesUnsafe.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/**
- * Copyright (c) 2014, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test;
-
-import java.lang.reflect.Field;
-import sun.misc.Unsafe;
-
-public class UsesUnsafe {
-    public static void main(String[] args) throws Exception {
-        Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
-        theUnsafe.setAccessible(true);
-        Unsafe unsafe = (Unsafe) theUnsafe.get(null);
-    }
-}
--- a/test/jdk/jigsaw/launcher/addexports/src/test/module-info.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-module test {
-}
-
--- a/test/jdk/jigsaw/launcher/addexports/src/testAdd/jdk/test/UsesInternalClass.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2014, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test;
-
-import one.internal.InternalClass;
-
-public class UsesInternalClass {
-    public static void main(String[] args) throws Exception {
-        InternalClass ic = new InternalClass();
-    }
-}
--- a/test/jdk/jigsaw/launcher/addexports/src/testAdd/module-info.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-module testAdd {
-    requires one.more;
-}
--- a/test/jdk/jigsaw/launcher/addexports/src/testUpgrade/jdk/test/UsesInternalTransaction.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2014, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.test;
-
-import javax.transaction.internal.InternalTransaction;
-
-public class UsesInternalTransaction {
-    public static void main(String[] args) throws Exception {
-        InternalTransaction ic = new InternalTransaction();
-    }
-}
--- a/test/jdk/jigsaw/launcher/addexports/src/testUpgrade/module-info.java	Sat Nov 14 11:31:48 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-module testUpgrade {
-    requires java.transaction;
-}
-