< prev index next >

test/jdk/tools/jpackage/share/RuntimePackageTest.java

Print this page

        

@@ -19,11 +19,15 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * 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.
  * Output of the test should be RuntimePackageTest*.* installer.
  * The installer should install Java Runtime without an application.

@@ -39,23 +43,27 @@
 /*
  * @test
  * @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) {
+        Test.run(args, () -> {
         new PackageTest()
         .addInitializer(cmd -> {
-            cmd.addArguments("--runtime-image", System.getProperty("java.home"));
+                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.setArgumentValue("--input", null);
+                cmd.removeArgument("--input");
         })
         .run();
+        });
     }
 }
< prev index next >