< prev index next >

test/jdk/tools/jpackage/linux/PackageDepsTest.java

Print this page




   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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
  21  * questions.
  22  */
  23 

  24 import jdk.jpackage.test.PackageTest;
  25 import jdk.jpackage.test.PackageType;
  26 
  27 
  28 /**
  29  * Test --linux-package-deps parameter. Output of the test should be
  30  * apackagedepstestprereq_1.0-1_amd64.deb and packagedepstest_1.0-1_amd64.deb or
  31  * apackagedepstestprereq-1.0-1.amd64.rpm and packagedepstest-1.0-1.amd64.rpm
  32  * package bundles. The output packages should provide the same functionality as
  33  * the default package.
  34  *
  35  * deb: Value of Depends property of packagedepstest package should contain
  36  * apackagedepstestprereq word.
  37  *
  38  * rpm: Value of Requires property of packagedepstest package should contain
  39  * apackagedepstestprereq word.
  40  */
  41 
  42 
  43 /*
  44  * @test
  45  * @summary jpackage with --linux-package-deps
  46  * @library ../helpers
  47  * @requires (os.family == "linux")
  48  * @modules jdk.jpackage/jdk.jpackage.internal
  49  * @run main/othervm/timeout=360 -Xmx512m PackageDepsTest
  50  */
  51 public class PackageDepsTest {
  52 
  53     // Pick the name of prerequisite package to be alphabetically
  54     // preceeding the main package name.
  55     // This is needed to make Bash script batch installing/uninstalling packages
  56     // produced by jtreg tests install/uninstall packages in the right order.
  57     static class APackageDepsTestPrereq {
  58 
  59         public static void main(String[] args) throws Exception {
  60             new PackageTest().forTypes(PackageType.LINUX).configureHelloApp().run();
  61         }
  62     }
  63 
  64     public static void main(String[] args) throws Exception {
  65         final String PREREQ_PACKAGE_NAME = "apackagedepstestprereq";
  66 

  67         APackageDepsTestPrereq.main(args);
  68 
  69         new PackageTest()
  70         .forTypes(PackageType.LINUX)
  71         .configureHelloApp()
  72         .addInitializer(cmd -> {
  73             cmd.addArguments("--linux-package-deps", PREREQ_PACKAGE_NAME);
  74         })
  75         .forTypes(PackageType.LINUX_DEB)
  76         .addBundlePropertyVerifier("Depends", PREREQ_PACKAGE_NAME)
  77         .forTypes(PackageType.LINUX_RPM)
  78         .addBundlePropertyVerifier("Requires", PREREQ_PACKAGE_NAME)
  79         .run();

  80     }
  81 }


   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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
  21  * questions.
  22  */
  23 
  24 import jdk.jpackage.test.Test;
  25 import jdk.jpackage.test.PackageTest;
  26 import jdk.jpackage.test.PackageType;
  27 
  28 
  29 /**
  30  * Test --linux-package-deps parameter. Output of the test should be
  31  * apackagedepstestprereq_1.0-1_amd64.deb and packagedepstest_1.0-1_amd64.deb or
  32  * apackagedepstestprereq-1.0-1.amd64.rpm and packagedepstest-1.0-1.amd64.rpm
  33  * package bundles. The output packages should provide the same functionality as
  34  * the default package.
  35  *
  36  * deb: Value of Depends property of packagedepstest package should contain
  37  * apackagedepstestprereq word.
  38  *
  39  * rpm: Value of Requires property of packagedepstest package should contain
  40  * apackagedepstestprereq word.
  41  */
  42 
  43 
  44 /*
  45  * @test
  46  * @summary jpackage with --linux-package-deps
  47  * @library ../helpers
  48  * @requires (os.family == "linux")
  49  * @modules jdk.jpackage/jdk.jpackage.internal
  50  * @run main/othervm/timeout=360 -Xmx512m PackageDepsTest
  51  */
  52 public class PackageDepsTest {
  53 
  54     // Pick the name of prerequisite package to be alphabetically
  55     // preceeding the main package name.
  56     // This is needed to make Bash script batch installing/uninstalling packages
  57     // produced by jtreg tests install/uninstall packages in the right order.
  58     static class APackageDepsTestPrereq {
  59 
  60         public static void main(String[] args) {
  61             new PackageTest().forTypes(PackageType.LINUX).configureHelloApp().run();
  62         }
  63     }
  64 
  65     public static void main(String[] args) {
  66         final String PREREQ_PACKAGE_NAME = "apackagedepstestprereq";
  67 
  68         Test.run(args, () -> {
  69             APackageDepsTestPrereq.main(args);
  70 
  71             new PackageTest()
  72             .forTypes(PackageType.LINUX)
  73             .configureHelloApp()
  74             .addInitializer(cmd -> {
  75                 cmd.addArguments("--linux-package-deps", PREREQ_PACKAGE_NAME);
  76             })
  77             .forTypes(PackageType.LINUX_DEB)
  78             .addBundlePropertyVerifier("Depends", PREREQ_PACKAGE_NAME)
  79             .forTypes(PackageType.LINUX_RPM)
  80             .addBundlePropertyVerifier("Requires", PREREQ_PACKAGE_NAME)
  81             .run();
  82         });
  83     }
  84 }
< prev index next >