11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 /*
27 * @test
28 * @summary Test if package p6 in module m2 is not exported, then class c5
29 * in an unnamed module can not access p6.c2 in module m2.
30 * @modules java.base/jdk.internal.misc
31 * @library /testlibrary /test/lib
32 * @compile myloaders/MySameClassLoader.java
33 * @compile p6/c6.java
34 * @compile c5.java
35 * @build UmodUpkg_NotExp
36 * @run main/othervm -Xbootclasspath/a:. UmodUpkg_NotExp
37 */
38
39 import static jdk.test.lib.Asserts.*;
40
41 import java.lang.reflect.Layer;
42 import java.lang.module.Configuration;
43 import java.lang.module.ModuleDescriptor;
44 import java.lang.module.ModuleFinder;
45 import java.util.HashMap;
46 import java.util.Map;
47 import java.util.Set;
48 import myloaders.MySameClassLoader;
49
50 // ClassLoader1 --> defines m1 --> no packages
51 // defines m2 --> packages p6
52 //
53 // m1 can read m2
54 // package p6 in m2 is not exported
55 //
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 /*
27 * @test
28 * @summary Test if package p6 in module m2 is not exported, then class c5
29 * in an unnamed module can not access p6.c2 in module m2.
30 * @modules java.base/jdk.internal.misc
31 * @library /test/lib
32 * @compile myloaders/MySameClassLoader.java
33 * @compile p6/c6.java
34 * @compile c5.java
35 * @run main/othervm -Xbootclasspath/a:. UmodUpkg_NotExp
36 */
37
38 import static jdk.test.lib.Asserts.*;
39
40 import java.lang.reflect.Layer;
41 import java.lang.module.Configuration;
42 import java.lang.module.ModuleDescriptor;
43 import java.lang.module.ModuleFinder;
44 import java.util.HashMap;
45 import java.util.Map;
46 import java.util.Set;
47 import myloaders.MySameClassLoader;
48
49 // ClassLoader1 --> defines m1 --> no packages
50 // defines m2 --> packages p6
51 //
52 // m1 can read m2
53 // package p6 in m2 is not exported
54 //
|