langtools/test/tools/jdeps/modules/GenModuleInfo.java
changeset 41442 14db641d4a9f
parent 41251 6112540cd0c1
child 42407 f3702cff2933
equal deleted inserted replaced
41441:8fb8d9c6c687 41442:14db641d4a9f
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @summary Tests jdeps --generate-module-info option
    26  * @summary Tests jdeps --generate-module-info option
    27  * @library ../lib
    27  * @library ../lib
    28  * @build CompilerUtils JdepsUtil
    28  * @build CompilerUtils JdepsUtil JdepsRunner
    29  * @modules jdk.jdeps/com.sun.tools.jdeps
    29  * @modules jdk.jdeps/com.sun.tools.jdeps
    30  * @run testng GenModuleInfo
    30  * @run testng GenModuleInfo
    31  */
    31  */
    32 
    32 
    33 import java.io.*;
    33 import java.io.*;
    95     @Test
    95     @Test
    96     public void jdeps() throws IOException {
    96     public void jdeps() throws IOException {
    97         Stream<String> files = Arrays.stream(modules)
    97         Stream<String> files = Arrays.stream(modules)
    98                 .map(mn -> LIBS_DIR.resolve(mn + ".jar"))
    98                 .map(mn -> LIBS_DIR.resolve(mn + ".jar"))
    99                 .map(Path::toString);
    99                 .map(Path::toString);
   100         JdepsUtil.jdeps(Stream.concat(Stream.of("-cp"), files).toArray(String[]::new));
   100         JdepsRunner.run(Stream.concat(Stream.of("-cp"), files).toArray(String[]::new));
   101     }
   101     }
   102 
   102 
   103     @Test
   103     @Test
   104     public void test() throws IOException {
   104     public void test() throws IOException {
   105         Stream<String> files = Arrays.stream(modules)
   105         Stream<String> files = Arrays.stream(modules)
   106                 .map(mn -> LIBS_DIR.resolve(mn + ".jar"))
   106                 .map(mn -> LIBS_DIR.resolve(mn + ".jar"))
   107                 .map(Path::toString);
   107                 .map(Path::toString);
   108 
   108 
   109         JdepsUtil.jdeps(Stream.concat(Stream.of("--generate-module-info", DEST_DIR.toString()),
   109         JdepsRunner.run(Stream.concat(Stream.of("--generate-module-info", DEST_DIR.toString()),
   110                                       files).toArray(String[]::new));
   110                                       files).toArray(String[]::new));
   111 
   111 
   112         // check file exists
   112         // check file exists
   113         Arrays.stream(modules)
   113         Arrays.stream(modules)
   114                 .map(mn -> DEST_DIR.resolve(mn).resolve("module-info.java"))
   114                 .map(mn -> DEST_DIR.resolve(mn).resolve("module-info.java"))