test/jdk/tools/jpackage/linux/PackageDepsTest.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.Test;
    24 import jdk.jpackage.test.PackageTest;
    25 import jdk.jpackage.test.PackageTest;
    25 import jdk.jpackage.test.PackageType;
    26 import jdk.jpackage.test.PackageType;
    26 
    27 
    27 
    28 
    28 /**
    29 /**
    54     // preceeding the main package name.
    55     // preceeding the main package name.
    55     // This is needed to make Bash script batch installing/uninstalling packages
    56     // This is needed to make Bash script batch installing/uninstalling packages
    56     // produced by jtreg tests install/uninstall packages in the right order.
    57     // produced by jtreg tests install/uninstall packages in the right order.
    57     static class APackageDepsTestPrereq {
    58     static class APackageDepsTestPrereq {
    58 
    59 
    59         public static void main(String[] args) throws Exception {
    60         public static void main(String[] args) {
    60             new PackageTest().forTypes(PackageType.LINUX).configureHelloApp().run();
    61             new PackageTest().forTypes(PackageType.LINUX).configureHelloApp().run();
    61         }
    62         }
    62     }
    63     }
    63 
    64 
    64     public static void main(String[] args) throws Exception {
    65     public static void main(String[] args) {
    65         final String PREREQ_PACKAGE_NAME = "apackagedepstestprereq";
    66         final String PREREQ_PACKAGE_NAME = "apackagedepstestprereq";
    66 
    67 
    67         APackageDepsTestPrereq.main(args);
    68         Test.run(args, () -> {
       
    69             APackageDepsTestPrereq.main(args);
    68 
    70 
    69         new PackageTest()
    71             new PackageTest()
    70         .forTypes(PackageType.LINUX)
    72             .forTypes(PackageType.LINUX)
    71         .configureHelloApp()
    73             .configureHelloApp()
    72         .addInitializer(cmd -> {
    74             .addInitializer(cmd -> {
    73             cmd.addArguments("--linux-package-deps", PREREQ_PACKAGE_NAME);
    75                 cmd.addArguments("--linux-package-deps", PREREQ_PACKAGE_NAME);
    74         })
    76             })
    75         .forTypes(PackageType.LINUX_DEB)
    77             .forTypes(PackageType.LINUX_DEB)
    76         .addBundlePropertyVerifier("Depends", PREREQ_PACKAGE_NAME)
    78             .addBundlePropertyVerifier("Depends", PREREQ_PACKAGE_NAME)
    77         .forTypes(PackageType.LINUX_RPM)
    79             .forTypes(PackageType.LINUX_RPM)
    78         .addBundlePropertyVerifier("Requires", PREREQ_PACKAGE_NAME)
    80             .addBundlePropertyVerifier("Requires", PREREQ_PACKAGE_NAME)
    79         .run();
    81             .run();
       
    82         });
    80     }
    83     }
    81 }
    84 }