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 Ensure no incubator modules are resolved by default in the image
28 * @library /lib/testlibrary /test/lib
29 * @modules jdk.compiler
30 * @build jdk.test.lib.compiler.CompilerUtils
31 * @run testng DefaultImage
32 */
33
34 import java.io.ByteArrayOutputStream;
35 import java.io.PrintStream;
36 import java.lang.module.ModuleDescriptor;
37 import java.lang.module.ModuleFinder;
38 import java.lang.module.ModuleReference;
39 import java.nio.file.Files;
40 import java.nio.file.Path;
41 import java.nio.file.Paths;
42 import java.util.function.Consumer;
43 import java.util.stream.Stream;
44 import jdk.test.lib.compiler.CompilerUtils;
45
46 import org.testng.annotations.BeforeTest;
47 import org.testng.annotations.Test;
48
49 import static java.nio.charset.StandardCharsets.UTF_8;
50 import static jdk.testlibrary.ProcessTools.executeCommand;
51 import static org.testng.Assert.*;
52
53 @Test
54 public class DefaultImage {
55 private static final String JAVA_HOME = System.getProperty("java.home");
56 private static final Path TEST_SRC = Paths.get(System.getProperty("test.src"));
57 private static final Path CP_DIR = Paths.get("cp");
58
59 @BeforeTest
60 private void setup() throws Throwable {
61 Path src = TEST_SRC.resolve("src").resolve("cp").resolve("listmods");
62 assertTrue(CompilerUtils.compile(src, CP_DIR));
63 }
64
65 public void test() throws Throwable {
66 if (isExplodedBuild()) {
67 System.out.println("Test cannot run on exploded build");
68 return;
69 }
70
|
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 Ensure no incubator modules are resolved by default in the image
28 * @library /test/lib
29 * @modules jdk.compiler
30 * @build jdk.test.lib.compiler.CompilerUtils
31 * @run testng DefaultImage
32 */
33
34 import java.io.ByteArrayOutputStream;
35 import java.io.PrintStream;
36 import java.lang.module.ModuleDescriptor;
37 import java.lang.module.ModuleFinder;
38 import java.lang.module.ModuleReference;
39 import java.nio.file.Files;
40 import java.nio.file.Path;
41 import java.nio.file.Paths;
42 import java.util.function.Consumer;
43 import java.util.stream.Stream;
44 import jdk.test.lib.compiler.CompilerUtils;
45
46 import org.testng.annotations.BeforeTest;
47 import org.testng.annotations.Test;
48
49 import static java.nio.charset.StandardCharsets.UTF_8;
50 import static jdk.test.lib.process.ProcessTools.executeCommand;
51 import static org.testng.Assert.*;
52
53 @Test
54 public class DefaultImage {
55 private static final String JAVA_HOME = System.getProperty("java.home");
56 private static final Path TEST_SRC = Paths.get(System.getProperty("test.src"));
57 private static final Path CP_DIR = Paths.get("cp");
58
59 @BeforeTest
60 private void setup() throws Throwable {
61 Path src = TEST_SRC.resolve("src").resolve("cp").resolve("listmods");
62 assertTrue(CompilerUtils.compile(src, CP_DIR));
63 }
64
65 public void test() throws Throwable {
66 if (isExplodedBuild()) {
67 System.out.println("Test cannot run on exploded build");
68 return;
69 }
70
|