1 /**
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 * @summary jlink test of --add-module ALL-MODULE-PATH
27 * @library /lib/testlibrary
28 * @modules jdk.compiler
29 * @build jdk.testlibrary.ProcessTools
30 * jdk.testlibrary.OutputAnalyzer
31 * CompilerUtils
32 * @run testng AllModulePath
33 */
34
35 import java.io.File;
36 import java.io.IOException;
37 import java.io.PrintWriter;
38 import java.nio.file.Files;
39 import java.nio.file.Path;
40 import java.nio.file.Paths;
41 import java.nio.file.attribute.BasicFileAttributes;
42 import java.util.ArrayList;
43 import java.util.Arrays;
44 import java.util.HashSet;
45 import java.util.List;
46 import java.util.Set;
47 import java.util.stream.Collectors;
48 import java.util.stream.Stream;
49 import java.util.spi.ToolProvider;
50
51 import jdk.testlibrary.ProcessTools;
52
53 import org.testng.annotations.BeforeClass;
54 import org.testng.annotations.Test;
55 import static org.testng.Assert.*;
56
57 public class AllModulePath {
58
59 private final Path JMODS = Paths.get(System.getProperty("test.jdk")).resolve("jmods");
60 private final Path SRC = Paths.get(System.getProperty("test.src")).resolve("src");
61 private final Path MODS = Paths.get("mods");
62
63 private final static Set<String> MODULES = Set.of("test", "m1");
64
65 static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
66 .orElseThrow(() ->
67 new RuntimeException("jlink tool not found")
68 );
69
70 @BeforeClass
|
1 /**
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 * @summary jlink test of --add-module ALL-MODULE-PATH
27 * @library /lib/testlibrary /test/lib
28 * @modules jdk.compiler
29 * @build jdk.testlibrary.ProcessTools
30 * jdk.testlibrary.OutputAnalyzer
31 * jdk.test.lib.compiler.CompilerUtils
32 * @run testng AllModulePath
33 */
34
35 import java.io.File;
36 import java.io.IOException;
37 import java.io.PrintWriter;
38 import java.nio.file.Files;
39 import java.nio.file.Path;
40 import java.nio.file.Paths;
41 import java.nio.file.attribute.BasicFileAttributes;
42 import java.util.ArrayList;
43 import java.util.Arrays;
44 import java.util.HashSet;
45 import java.util.List;
46 import java.util.Set;
47 import java.util.stream.Collectors;
48 import java.util.stream.Stream;
49 import java.util.spi.ToolProvider;
50
51 import jdk.test.lib.compiler.CompilerUtils;
52 import jdk.testlibrary.ProcessTools;
53
54 import org.testng.annotations.BeforeClass;
55 import org.testng.annotations.Test;
56 import static org.testng.Assert.*;
57
58 public class AllModulePath {
59
60 private final Path JMODS = Paths.get(System.getProperty("test.jdk")).resolve("jmods");
61 private final Path SRC = Paths.get(System.getProperty("test.src")).resolve("src");
62 private final Path MODS = Paths.get("mods");
63
64 private final static Set<String> MODULES = Set.of("test", "m1");
65
66 static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
67 .orElseThrow(() ->
68 new RuntimeException("jlink tool not found")
69 );
70
71 @BeforeClass
|