10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @library /test/lib
27 * @modules java.base/jdk.internal.module
28 * jdk.compiler
29 * jdk.jlink
30 * @build ModuleReaderTest jdk.test.lib.compiler.CompilerUtils JarUtils
31 * @run testng ModuleReaderTest
32 * @summary Basic tests for java.lang.module.ModuleReader
33 */
34
35 import java.io.File;
36 import java.io.IOException;
37 import java.io.InputStream;
38 import java.lang.module.ModuleFinder;
39 import java.lang.module.ModuleReader;
40 import java.lang.module.ModuleReference;
41 import java.net.URI;
42 import java.net.URL;
43 import java.net.URLConnection;
44 import java.nio.ByteBuffer;
45 import java.nio.file.Files;
46 import java.nio.file.Path;
47 import java.nio.file.Paths;
48 import java.util.Arrays;
49 import java.util.HashSet;
50 import java.util.List;
51 import java.util.Optional;
52 import java.util.Set;
53 import java.util.stream.Collectors;
54 import java.util.spi.ToolProvider;
55
56 import jdk.internal.module.ModulePath;
57 import jdk.test.lib.compiler.CompilerUtils;
58
59 import org.testng.annotations.BeforeTest;
60 import org.testng.annotations.Test;
61 import static org.testng.Assert.*;
62
63 @Test
64 public class ModuleReaderTest {
65
66 private static final String TEST_SRC = System.getProperty("test.src");
67
68 private static final Path USER_DIR = Paths.get(System.getProperty("user.dir"));
69 private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
70 private static final Path MODS_DIR = Paths.get("mods");
71
72 // the module name of the base module
73 private static final String BASE_MODULE = "java.base";
74
75 // the module name of the test module
76 private static final String TEST_MODULE = "m";
77
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @library /test/lib
27 * @modules java.base/jdk.internal.module
28 * jdk.compiler
29 * jdk.jlink
30 * @build ModuleReaderTest
31 * jdk.test.lib.compiler.CompilerUtils
32 * jdk.test.lib.util.JarUtils
33 * @run testng ModuleReaderTest
34 * @summary Basic tests for java.lang.module.ModuleReader
35 */
36
37 import java.io.File;
38 import java.io.IOException;
39 import java.io.InputStream;
40 import java.lang.module.ModuleFinder;
41 import java.lang.module.ModuleReader;
42 import java.lang.module.ModuleReference;
43 import java.net.URI;
44 import java.net.URL;
45 import java.net.URLConnection;
46 import java.nio.ByteBuffer;
47 import java.nio.file.Files;
48 import java.nio.file.Path;
49 import java.nio.file.Paths;
50 import java.util.Arrays;
51 import java.util.HashSet;
52 import java.util.List;
53 import java.util.Optional;
54 import java.util.Set;
55 import java.util.stream.Collectors;
56 import java.util.spi.ToolProvider;
57
58 import jdk.internal.module.ModulePath;
59 import jdk.test.lib.compiler.CompilerUtils;
60 import jdk.test.lib.util.JarUtils;
61
62 import org.testng.annotations.BeforeTest;
63 import org.testng.annotations.Test;
64 import static org.testng.Assert.*;
65
66 @Test
67 public class ModuleReaderTest {
68
69 private static final String TEST_SRC = System.getProperty("test.src");
70
71 private static final Path USER_DIR = Paths.get(System.getProperty("user.dir"));
72 private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
73 private static final Path MODS_DIR = Paths.get("mods");
74
75 // the module name of the base module
76 private static final String BASE_MODULE = "java.base";
77
78 // the module name of the test module
79 private static final String TEST_MODULE = "m";
80
|