changeset 58881:5d9568d14dc9

8242859: test/jdk/tools/jlink/JLinkTest.java uses nashorn module Reviewed-by: jlaskey
author sundar
date Fri, 17 Apr 2020 18:12:19 +0530
parents 6611a79f2ddf
children df768a80bb19
files test/jdk/tools/jlink/JLinkTest.java
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/tools/jlink/JLinkTest.java	Fri Apr 17 20:11:39 2020 +0800
+++ b/test/jdk/tools/jlink/JLinkTest.java	Fri Apr 17 18:12:19 2020 +0530
@@ -110,6 +110,28 @@
         }
 
         {
+             // No --module-path specified. $JAVA_HOME/jmods should be assumed.
+             // The following should succeed as it uses only system modules.
+             String imageDir = "bug818977-no-modulepath";
+             JImageGenerator.getJLinkTask()
+                     .output(helper.createNewImageDir(imageDir))
+                     .addMods("jdk.jshell")
+                     .call().assertSuccess();
+        }
+
+        {
+             // invalid --module-path specified. java.base not found it it.
+             // $JAVA_HOME/jmods should be added automatically.
+             // The following should succeed as it uses only system modules.
+             String imageDir = "bug8189777-invalid-modulepath";
+             JImageGenerator.getJLinkTask()
+                     .modulePath("does_not_exist_path")
+                     .output(helper.createNewImageDir(imageDir))
+                     .addMods("jdk.jshell")
+                     .call().assertSuccess();
+        }
+
+        {
             // No --module-path specified. --add-modules ALL-MODULE-PATH specified.
             String imageDir = "bug8189777-all-module-path";
             JImageGenerator.getJLinkTask()