< prev index next >

test/tools/jmod/JmodTest.java

Print this page

        

*** 22,33 **** */ /* * @test * @library /lib/testlibrary ! * @modules jdk.jlink/jdk.tools.jmod ! * jdk.compiler * @build jdk.testlibrary.FileUtils CompilerUtils * @run testng JmodTest * @summary Basic test for jmod */ --- 22,33 ---- */ /* * @test * @library /lib/testlibrary ! * @modules jdk.compiler ! * jdk.jlink * @build jdk.testlibrary.FileUtils CompilerUtils * @run testng JmodTest * @summary Basic test for jmod */
*** 36,45 **** --- 36,46 ---- import java.lang.reflect.Method; import java.nio.file.*; import java.util.*; import java.util.function.Consumer; import java.util.regex.Pattern; + import java.util.spi.ToolProvider; import java.util.stream.Stream; import jdk.testlibrary.FileUtils; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test;
*** 49,58 **** --- 50,61 ---- import static java.util.stream.Collectors.toSet; import static org.testng.Assert.*; public class JmodTest { + static final ToolProvider JMOD_TOOL = ToolProvider.findFirst("jmod").get(); + static final String TEST_SRC = System.getProperty("test.src", "."); static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); static final Path EXPLODED_DIR = Paths.get("build"); static final Path MODS_DIR = Paths.get("jmods");
*** 477,487 **** static JmodResult jmod(String... args) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); System.out.println("jmod " + Arrays.asList(args)); ! int ec = jdk.tools.jmod.Main.run(args, ps); return new JmodResult(ec, new String(baos.toByteArray(), UTF_8)); } static class JmodResult { final int exitCode; --- 480,490 ---- static JmodResult jmod(String... args) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); System.out.println("jmod " + Arrays.asList(args)); ! int ec = JMOD_TOOL.run(ps, ps, args); return new JmodResult(ec, new String(baos.toByteArray(), UTF_8)); } static class JmodResult { final int exitCode;
< prev index next >