langtools/test/tools/javac/classfiles/attributes/Module/ModuleTest.java
author alanb
Thu, 17 Mar 2016 19:04:28 +0000
changeset 36526 3b41f1c69604
child 36778 e04318f39f92
permissions -rw-r--r--
8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: jjg, jlahoda, vromero, mcimadamore, bpatel, ksrini, darcy, anazarov, dfuchs Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, jan.lahoda@oracle.com, vicente.romero@oracle.com, andreas.lundblad@oracle.com, andrey.x.nazarov@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, kumar.x.srinivasan@oracle.com, sundararajan.athijegannathan@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * accompanied this code).
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * questions.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    23
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    24
/*
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    25
 * @test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    26
 * @summary Module attribute tests
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    27
 * @bug 8080878
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    28
 * @modules jdk.compiler/com.sun.tools.javac.api
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    29
 *          jdk.compiler/com.sun.tools.javac.main
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    30
 *          jdk.compiler/com.sun.tools.javac.util
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    31
 *          jdk.jdeps/com.sun.tools.classfile
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    32
 *          jdk.jdeps/com.sun.tools.javap
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    33
 * @library /tools/lib ../lib /tools/javac/lib
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    34
 * @build ToolBox TestBase TestResult ModuleTestBase
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    35
 * @run main ModuleTest
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    36
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    37
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    38
import java.nio.file.Path;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    39
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    40
public class ModuleTest extends ModuleTestBase {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    41
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    42
    public static void main(String[] args) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    43
        new ModuleTest().run();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    44
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    45
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    46
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    47
    public void testEmptyModule(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    48
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    49
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    50
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    51
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    52
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    53
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    54
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    55
    public void testExports(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    56
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    57
                .exports("pack")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    58
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    59
        tb.writeJavaFiles(base, "package pack; public class C extends java.util.ArrayList{}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    60
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    61
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    62
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    63
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    64
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    65
    public void testSeveralExports(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    66
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    67
                .exports("pack")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    68
                .exports("pack2")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    69
                .exports("pack3")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    70
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    71
        tb.writeJavaFiles(base,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    72
                "package pack; public class A {}",
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    73
                "package pack2; public class B {}",
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    74
                "package pack3; public class C {}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    75
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    76
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    77
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    78
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    79
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    80
    public void testQualifiedExports(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    81
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    82
                .exportsTo("pack", "jdk.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    83
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    84
        tb.writeJavaFiles(base, "package pack; public class A {}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    85
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    86
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    87
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    88
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    89
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    90
    public void testSeveralQualifiedExports(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    91
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    92
                .exportsTo("pack", "jdk.compiler, java.xml")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    93
                .exportsTo("pack2", "java.xml")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    94
                .exportsTo("pack3", "jdk.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    95
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    96
        tb.writeJavaFiles(base,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    97
                "package pack; public class A {}",
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    98
                "package pack2; public class B {}",
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    99
                "package pack3; public class C {}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   100
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   101
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   102
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   103
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   104
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   105
    public void testRequires(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   106
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   107
                .requires("jdk.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   108
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   109
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   110
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   111
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   112
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   113
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   114
    public void testRequiresPublic(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   115
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   116
                .requiresPublic("java.xml")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   117
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   118
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   119
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   120
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   121
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   122
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   123
    public void testSeveralRequires(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   124
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   125
                .requiresPublic("java.xml")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   126
                .requires("java.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   127
                .requires("jdk.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   128
                .requiresPublic("jdk.scripting.nashorn")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   129
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   130
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   131
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   132
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   133
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   134
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   135
    public void testProvides(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   136
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   137
                .provides("java.util.Collection", "pack2.D")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   138
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   139
        tb.writeJavaFiles(base, "package pack2; public class D extends java.util.ArrayList{}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   140
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   141
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   142
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   143
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   144
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   145
    public void testSeveralProvides(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   146
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   147
                .provides("java.util.Collection", "pack2.D")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   148
                .provides("java.util.List", "pack2.D")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   149
                .requires("java.logging")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   150
                .provides("java.util.logging.Logger", "pack2.C")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   151
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   152
        tb.writeJavaFiles(base, "package pack2; public class D extends java.util.ArrayList{}",
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   153
                "package pack2; public class C extends java.util.logging.Logger{ " +
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   154
                        "public C() { super(\"\",\"\"); } \n" +
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   155
                        "C(String a,String b){" +
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   156
                        "    super(a,b);" +
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   157
                        "}}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   158
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   159
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   160
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   161
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   162
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   163
    public void testUses(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   164
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   165
                .uses("java.util.List")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   166
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   167
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   168
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   169
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   170
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   171
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   172
    public void testSeveralUses(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   173
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   174
                .uses("java.util.List")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   175
                .uses("java.util.Collection")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   176
                .requires("java.logging")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   177
                .uses("java.util.logging.Logger")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   178
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   179
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   180
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   181
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   182
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   183
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   184
    public void testComplex(Path base) throws Exception {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   185
        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   186
                .exports("pack1")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   187
                .exportsTo("packTo1", "java.xml")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   188
                .requires("jdk.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   189
                .requiresPublic("java.xml")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   190
                .provides("java.util.List", "pack1.C")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   191
                .uses("java.util.List")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   192
                .uses("java.nio.file.Path")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   193
                .provides("java.util.List", "pack2.D")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   194
                .requiresPublic("java.desktop")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   195
                .requires("java.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   196
                .exportsTo("packTo2", "java.compiler")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   197
                .exports("pack2")
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   198
                .write(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   199
        tb.writeJavaFiles(base, "package pack1; public class C extends java.util.ArrayList{}",
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   200
                "package pack2; public class D extends java.util.ArrayList{}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   201
        tb.writeJavaFiles(base,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   202
                "package packTo1; public class T1 {}",
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   203
                "package packTo2; public class T2 {}");
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   204
        compile(base);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   205
        testModuleAttribute(base, moduleDescriptor);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   206
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   207
}