test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageModuleTest.java
branchJDK-8200758-branch
changeset 57395 521c02b9eed0
parent 57307 4948a1944cf9
child 57414 6eda749d3117
--- a/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageModuleTest.java	Thu Jun 06 19:28:40 2019 -0400
+++ b/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageModuleTest.java	Thu Jun 06 19:31:11 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
  /*
  * @test
- * @summary jpackage create image module test
+ * @summary jpackage create image modular jar test
  * @library ../helpers
  * @build JPackageHelper
  * @build JPackagePath
@@ -34,18 +34,43 @@
 public class JPackageCreateAppImageModuleTest {
     private static final String OUTPUT = "output";
 
-    private static final String [] CMD = {
+    private static final String [] CMD1 = {
         "create-app-image",
+        "--module-path", "module",
+        "--module", "com.other/com.other.Other",
+        "--output", OUTPUT,
+        "--name", "test",
+    };
+
+    private static String [] commands = {
+        "create-app-image",
+        "--module-path", "module",
+        "--module", "com.other/com.other.Other",
         "--output", OUTPUT,
         "--name", "test",
-        "--module", "com.hello/com.hello.Hello",
-        "--module-path", "input"};
+        "--add-modules", "TBD",
+    };
+
+    private final static String [] paths = {
+        "ALL-MODULES",
+        "ALL_MODULE_PATH",
+        "ALL-SYSTEM",
+        "ALL-DEFAULT",
+    };
 
     public static void main(String[] args) throws Exception {
-        JPackageHelper.createHelloModule();
-        JPackageCreateAppImageBase.testCreateAppImage(CMD);
+        JPackageHelper.createOtherModule();
+
         JPackageHelper.deleteOutputFolder(OUTPUT);
-        JPackageCreateAppImageBase.testCreateAppImageToolProvider(CMD);
+        JPackageCreateAppImageBase.testCreateAppImage(CMD1);
+
+        for (String path : paths) {
+            commands[commands.length - 1] = path;
+            System.out.println("using --add-modules " + path);
+            JPackageHelper.deleteOutputFolder(OUTPUT);
+            JPackageCreateAppImageBase.testCreateAppImageToolProvider(commands);
+            System.out.println("succeeded");
+        }
     }
 
 }