< prev index next >

jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java

Print this page

        

@@ -23,12 +23,12 @@
 
 /**
  * @test
  * @library /lib/testlibrary
  * @modules java.base/jdk.internal.module
- *          jdk.jlink/jdk.tools.jmod
  *          jdk.compiler
+ *          jdk.jlink
  * @build ModuleReaderTest CompilerUtils JarUtils
  * @run testng ModuleReaderTest
  * @summary Basic tests for java.lang.module.ModuleReader
  */
 

@@ -46,10 +46,11 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.Optional;
+import java.util.spi.ToolProvider;
 
 import jdk.internal.module.ConfigurableModuleFinder;
 import jdk.internal.module.ConfigurableModuleFinder.Phase;
 
 import org.testng.annotations.BeforeTest;

@@ -194,12 +195,15 @@
 
         // jmod create --class-path mods/${TESTMODULE}  mlib/${TESTMODULE}.jmod
         String cp = MODS_DIR.resolve(TEST_MODULE).toString();
         String jmod = dir.resolve("m.jmod").toString();
         String[] args = { "create", "--class-path", cp, jmod };
-        jdk.tools.jmod.JmodTask task = new jdk.tools.jmod.JmodTask();
-        assertEquals(task.run(args), 0);
+        ToolProvider jmodTool = ToolProvider.findFirst("jmod")
+            .orElseThrow(() ->
+                new RuntimeException("jmod tool not found")
+            );
+        assertEquals(jmodTool.run(System.out, System.out, args), 0);
 
         test(dir);
     }
 
 
< prev index next >