21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 import jdk.jpackage.test.PackageType; |
24 import jdk.jpackage.test.PackageType; |
25 import jdk.jpackage.test.PackageTest; |
25 import jdk.jpackage.test.PackageTest; |
26 import jdk.jpackage.test.Test; |
26 import jdk.jpackage.test.TKit; |
27 |
27 |
28 |
28 |
29 /** |
29 /** |
30 * Test --linux-app-release parameter. Output of the test should be |
30 * Test --linux-app-release parameter. Output of the test should be |
31 * releasetest_1.0-Rc3_amd64.deb or releasetest-1.0-Rc3.amd64.rpm package |
31 * releasetest_1.0-Rc3_amd64.deb or releasetest-1.0-Rc3.amd64.rpm package |
41 |
41 |
42 /* |
42 /* |
43 * @test |
43 * @test |
44 * @summary jpackage with --linux-app-release |
44 * @summary jpackage with --linux-app-release |
45 * @library ../helpers |
45 * @library ../helpers |
|
46 * @build jdk.jpackage.test.* |
46 * @requires (os.family == "linux") |
47 * @requires (os.family == "linux") |
47 * @modules jdk.jpackage/jdk.jpackage.internal |
48 * @modules jdk.jpackage/jdk.jpackage.internal |
48 * @run main/othervm/timeout=360 -Xmx512m ReleaseTest |
49 * @run main/othervm/timeout=360 -Xmx512m ReleaseTest |
49 */ |
50 */ |
50 public class ReleaseTest { |
51 public class ReleaseTest { |
51 |
52 |
52 public static void main(String[] args) { |
53 public static void main(String[] args) { |
53 final String RELEASE = "Rc3"; |
54 final String RELEASE = "Rc3"; |
54 |
55 |
55 Test.run(args, () -> { |
56 TKit.run(args, () -> { |
56 new PackageTest() |
57 new PackageTest() |
57 .forTypes(PackageType.LINUX) |
58 .forTypes(PackageType.LINUX) |
58 .configureHelloApp() |
59 .configureHelloApp() |
59 .addInitializer(cmd -> { |
60 .addInitializer(cmd -> { |
60 cmd.addArguments("--linux-app-release", RELEASE); |
61 cmd.addArguments("--linux-app-release", RELEASE); |
61 }) |
62 }) |
62 .forTypes(PackageType.LINUX_RPM) |
63 .forTypes(PackageType.LINUX_RPM) |
63 .addBundlePropertyVerifier("Release", RELEASE) |
64 .addBundlePropertyVerifier("Release", RELEASE) |
64 .forTypes(PackageType.LINUX_DEB) |
65 .forTypes(PackageType.LINUX_DEB) |
65 .addBundlePropertyVerifier("Version", (propName, propValue) -> { |
66 .addBundlePropertyVerifier("Version", (propName, propValue) -> { |
66 Test.assertTrue(propValue.endsWith("-" + RELEASE), |
67 TKit.assertTrue(propValue.endsWith("-" + RELEASE), |
67 String.format("Check value of %s property [%s] ends with %s", |
68 String.format("Check value of %s property [%s] ends with %s", |
68 propName, propValue, RELEASE)); |
69 propName, propValue, RELEASE)); |
69 }) |
70 }) |
70 .run(); |
71 .run(); |
71 }); |
72 }); |