22 */ |
22 */ |
23 |
23 |
24 import jdk.jpackage.test.TKit; |
24 import jdk.jpackage.test.TKit; |
25 import jdk.jpackage.test.PackageTest; |
25 import jdk.jpackage.test.PackageTest; |
26 import jdk.jpackage.test.FileAssociations; |
26 import jdk.jpackage.test.FileAssociations; |
|
27 import jdk.jpackage.test.Annotations.Test; |
27 |
28 |
28 /** |
29 /** |
29 * Test --file-associations parameter. Output of the test should be |
30 * Test --file-associations parameter. Output of the test should be |
30 * fileassociationstest*.* installer. The output installer should provide the |
31 * fileassociationstest*.* installer. The output installer should provide the |
31 * same functionality as the default installer (see description of the default |
32 * same functionality as the default installer (see description of the default |
47 * @test |
48 * @test |
48 * @summary jpackage with --file-associations |
49 * @summary jpackage with --file-associations |
49 * @library ../helpers |
50 * @library ../helpers |
50 * @build jdk.jpackage.test.* |
51 * @build jdk.jpackage.test.* |
51 * @modules jdk.jpackage/jdk.jpackage.internal |
52 * @modules jdk.jpackage/jdk.jpackage.internal |
52 * @run main/othervm/timeout=360 -Xmx512m FileAssociationsTest |
53 * @compile FileAssociationsTest.java |
|
54 * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main |
|
55 * --jpt-run=FileAssociationsTest |
53 */ |
56 */ |
54 public class FileAssociationsTest { |
57 public class FileAssociationsTest { |
55 public static void main(String[] args) { |
58 @Test |
56 TKit.run(args, () -> { |
59 public static void test() { |
57 PackageTest packageTest = new PackageTest(); |
60 PackageTest packageTest = new PackageTest(); |
58 |
61 |
59 applyFileAssociations(packageTest, new FileAssociations("jptest1")); |
62 applyFileAssociations(packageTest, new FileAssociations("jptest1")); |
60 applyFileAssociations(packageTest, |
63 applyFileAssociations(packageTest, |
61 new FileAssociations("jptest2").setFilename("fa2")); |
64 new FileAssociations("jptest2").setFilename("fa2")); |
62 packageTest.run(); |
65 packageTest.run(); |
63 }); |
|
64 } |
66 } |
65 |
67 |
66 private static void applyFileAssociations(PackageTest test, |
68 private static void applyFileAssociations(PackageTest test, |
67 FileAssociations fa) { |
69 FileAssociations fa) { |
68 test.addInitializer(cmd -> { |
70 test.addInitializer(cmd -> { |