test/jdk/tools/jpackage/share/RuntimePackageTest.java
branchJDK-8200758-branch
changeset 58301 e0efb29609bd
parent 58113 885b0543f6e4
child 58416 f09bf58c1f17
--- a/test/jdk/tools/jpackage/share/RuntimePackageTest.java	Mon Sep 16 19:24:32 2019 -0400
+++ b/test/jdk/tools/jpackage/share/RuntimePackageTest.java	Tue Sep 24 13:41:16 2019 -0400
@@ -21,7 +21,11 @@
  * questions.
  */
 
+import java.nio.file.Path;
+import java.util.Optional;
+import jdk.jpackage.test.Test;
 import jdk.jpackage.test.PackageTest;
+import jdk.jpackage.test.JPackageCommand;
 
 /**
  * Test --runtime-image parameter.
@@ -41,21 +45,25 @@
  * @summary jpackage with --runtime-image
  * @library ../helpers
  * @comment Temporary disable for Linux and OSX until functionality implemented
- * @requires (os.family == "windows")
+ * @requires (os.family != "mac")
  * @modules jdk.jpackage/jdk.jpackage.internal
- * @run main/othervm -Xmx512m RuntimePackageTest
+ * @run main/othervm/timeout=360 -Xmx512m RuntimePackageTest
  */
 public class RuntimePackageTest {
 
     public static void main(String[] args) {
-        new PackageTest()
-        .addInitializer(cmd -> {
-            cmd.addArguments("--runtime-image", System.getProperty("java.home"));
-            // Remove --input parameter from jpackage command line as we don't
-            // create input directory in the test and jpackage fails
-            // if --input references non existant directory.
-            cmd.setArgumentValue("--input", null);
-        })
-        .run();
+        Test.run(args, () -> {
+            new PackageTest()
+            .addInitializer(cmd -> {
+                cmd.addArguments("--runtime-image", Optional.ofNullable(
+                        JPackageCommand.DEFAULT_RUNTIME_IMAGE).orElse(Path.of(
+                                System.getProperty("java.home"))));
+                // Remove --input parameter from jpackage command line as we don't
+                // create input directory in the test and jpackage fails
+                // if --input references non existant directory.
+                cmd.removeArgument("--input");
+            })
+            .run();
+        });
     }
 }