< prev index next >

test/tools/jmod/hashes/HashesTest.java

Print this page

        

*** 25,36 **** * @test * @summary Test the recording and checking of module hashes * @author Andrei Eremeev * @library /lib/testlibrary * @modules java.base/jdk.internal.module ! * jdk.jlink/jdk.tools.jlink.internal ! * jdk.jlink/jdk.tools.jmod * jdk.compiler * @build CompilerUtils * @run testng HashesTest */ --- 25,35 ---- * @test * @summary Test the recording and checking of module hashes * @author Andrei Eremeev * @library /lib/testlibrary * @modules java.base/jdk.internal.module ! * jdk.jlink * jdk.compiler * @build CompilerUtils * @run testng HashesTest */
*** 51,70 **** --- 50,71 ---- import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.Set; + import java.util.spi.ToolProvider; import java.util.stream.Collectors; import jdk.internal.module.ConfigurableModuleFinder; import jdk.internal.module.ModuleHashes; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import static org.testng.Assert.*; public class HashesTest { + static final ToolProvider JMOD_TOOL = ToolProvider.findFirst("jmod").get(); private final Path testSrc = Paths.get(System.getProperty("test.src")); private final Path modSrc = testSrc.resolve("src"); private final Path mods = Paths.get("mods"); private final Path jmods = Paths.get("jmods");
*** 202,212 **** runJmod(args); } private void runJmod(List<String> args) { ! int rc = jdk.tools.jmod.Main.run(args.toArray(new String[args.size()]), System.out); System.out.println("jmod options: " + args.stream().collect(Collectors.joining(" "))); if (rc != 0) { throw new AssertionError("Jmod failed: rc = " + rc); } } --- 203,213 ---- runJmod(args); } private void runJmod(List<String> args) { ! int rc = JMOD_TOOL.run(System.out, System.out, args.toArray(new String[args.size()])); System.out.println("jmod options: " + args.stream().collect(Collectors.joining(" "))); if (rc != 0) { throw new AssertionError("Jmod failed: rc = " + rc); } }
< prev index next >