test/jdk/tools/jpackage/linux/ReleaseTest.java
branchJDK-8200758-branch
changeset 58301 e0efb29609bd
parent 58113 885b0543f6e4
child 58416 f09bf58c1f17
equal deleted inserted replaced
58172:bf06a1d3aef6 58301:e0efb29609bd
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
       
    24 import jdk.jpackage.test.PackageType;
    24 import jdk.jpackage.test.PackageTest;
    25 import jdk.jpackage.test.PackageTest;
    25 import jdk.jpackage.test.PackageType;
       
    26 import jdk.jpackage.test.Test;
    26 import jdk.jpackage.test.Test;
    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
    47  * @modules jdk.jpackage/jdk.jpackage.internal
    47  * @modules jdk.jpackage/jdk.jpackage.internal
    48  * @run main/othervm/timeout=360 -Xmx512m ReleaseTest
    48  * @run main/othervm/timeout=360 -Xmx512m ReleaseTest
    49  */
    49  */
    50 public class ReleaseTest {
    50 public class ReleaseTest {
    51 
    51 
    52     public static void main(String[] args) throws Exception {
    52     public static void main(String[] args) {
    53         final String RELEASE = "Rc3";
    53         final String RELEASE = "Rc3";
    54 
    54 
    55         new PackageTest()
    55         Test.run(args, () -> {
    56         .forTypes(PackageType.LINUX)
    56             new PackageTest()
    57         .configureHelloApp()
    57             .forTypes(PackageType.LINUX)
    58         .addInitializer(cmd -> {
    58             .configureHelloApp()
    59             cmd.addArguments("--linux-app-release", RELEASE);
    59             .addInitializer(cmd -> {
    60         })
    60                 cmd.addArguments("--linux-app-release", RELEASE);
    61         .forTypes(PackageType.LINUX_RPM)
    61             })
    62         .addBundlePropertyVerifier("Release", RELEASE)
    62             .forTypes(PackageType.LINUX_RPM)
    63         .forTypes(PackageType.LINUX_DEB)
    63             .addBundlePropertyVerifier("Release", RELEASE)
    64         .addBundlePropertyVerifier("Version", (propName, propValue) -> {
    64             .forTypes(PackageType.LINUX_DEB)
    65             Test.assertTrue(propValue.endsWith("-" + RELEASE),
    65             .addBundlePropertyVerifier("Version", (propName, propValue) -> {
    66                     String.format("Check value of %s property [%s] ends with %s",
    66                 Test.assertTrue(propValue.endsWith("-" + RELEASE),
    67                             propName, propValue, RELEASE));
    67                         String.format("Check value of %s property [%s] ends with %s",
    68         })
    68                                 propName, propValue, RELEASE));
    69         .run();
    69             })
       
    70             .run();
       
    71         });
    70     }
    72     }
    71 }
    73 }