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 * @bug 8170859
27 * @summary Basic test for incubator modules in jmods and images
28 * @library /lib/testlibrary /test/lib
29 * @key intermittent
30 * @modules jdk.compiler jdk.jartool jdk.jlink
31 * @build jdk.test.lib.Platform
32 * jdk.test.lib.util.FileUtils
33 * jdk.test.lib.compiler.CompilerUtils
34 * @run testng/othervm ImageModules
35 */
36
37 import java.io.ByteArrayOutputStream;
38 import java.io.File;
39 import java.io.IOException;
40 import java.io.PrintStream;
41 import java.nio.file.Files;
42 import java.nio.file.Path;
43 import java.nio.file.Paths;
44 import java.util.List;
45 import java.util.function.Consumer;
46 import java.util.spi.ToolProvider;
47 import java.util.stream.Collectors;
48 import java.util.stream.Stream;
49
50 import jdk.test.lib.compiler.CompilerUtils;
51 import jdk.test.lib.util.FileUtils;
52 import org.testng.annotations.BeforeTest;
53 import org.testng.annotations.DataProvider;
54 import org.testng.annotations.Test;
55
56 import static java.nio.charset.StandardCharsets.UTF_8;
57 import static jdk.testlibrary.ProcessTools.executeCommand;
58 import static org.testng.Assert.*;
59
60 public class ImageModules {
61 private static final String JAVA_HOME = System.getProperty("java.home");
62 private static final Path JDK_JMODS = Paths.get(JAVA_HOME, "jmods");
63
64 private static final Path TEST_SRC = Paths.get(System.getProperty("test.src"));
65 private static final Path MODS_DIR = Paths.get("mods");
66 private static final Path CP_DIR = Paths.get("cp");
67 private static final Path JARS_DIR = Paths.get("jars");
68 private static final Path JMODS_DIR = Paths.get("jmods");
69 private static final Path IMAGE = Paths.get("image");
70
71 private static final String JAVA_BASE = "java.base";
72 private final String[] modules = new String[] { "message.writer",
73 "message.converter" };
74
75 @BeforeTest
76 private void setup() throws Throwable {
77 Path src = TEST_SRC.resolve("src");
|
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 * @bug 8170859
27 * @summary Basic test for incubator modules in jmods and images
28 * @library /test/lib
29 * @key intermittent
30 * @modules jdk.compiler jdk.jartool jdk.jlink
31 * @build jdk.test.lib.Platform
32 * jdk.test.lib.util.FileUtils
33 * jdk.test.lib.compiler.CompilerUtils
34 * @run testng/othervm ImageModules
35 */
36
37 import java.io.ByteArrayOutputStream;
38 import java.io.File;
39 import java.io.IOException;
40 import java.io.PrintStream;
41 import java.nio.file.Files;
42 import java.nio.file.Path;
43 import java.nio.file.Paths;
44 import java.util.List;
45 import java.util.function.Consumer;
46 import java.util.spi.ToolProvider;
47 import java.util.stream.Collectors;
48 import java.util.stream.Stream;
49
50 import jdk.test.lib.compiler.CompilerUtils;
51 import jdk.test.lib.util.FileUtils;
52 import org.testng.annotations.BeforeTest;
53 import org.testng.annotations.DataProvider;
54 import org.testng.annotations.Test;
55
56 import static java.nio.charset.StandardCharsets.UTF_8;
57 import static jdk.test.lib.process.ProcessTools.executeCommand;
58 import static org.testng.Assert.*;
59
60 public class ImageModules {
61 private static final String JAVA_HOME = System.getProperty("java.home");
62 private static final Path JDK_JMODS = Paths.get(JAVA_HOME, "jmods");
63
64 private static final Path TEST_SRC = Paths.get(System.getProperty("test.src"));
65 private static final Path MODS_DIR = Paths.get("mods");
66 private static final Path CP_DIR = Paths.get("cp");
67 private static final Path JARS_DIR = Paths.get("jars");
68 private static final Path JMODS_DIR = Paths.get("jmods");
69 private static final Path IMAGE = Paths.get("image");
70
71 private static final String JAVA_BASE = "java.base";
72 private final String[] modules = new String[] { "message.writer",
73 "message.converter" };
74
75 @BeforeTest
76 private void setup() throws Throwable {
77 Path src = TEST_SRC.resolve("src");
|