< prev index next >

test/jdk/tools/jpackage/windows/WinUpgradeUUIDTest.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  * Test both --win-upgrade-uuid and --app-version parameters. Output of the test
  29  * should be WinUpgradeUUIDTest-1.0.exe and WinUpgradeUUIDTest-2.0.exe
  30  * installers. Both output installers should provide the same functionality as
  31  * the default installer (see description of the default installer in
  32  * SimplePackageTest.java) but have the same product code and different
  33  * versions. Running WinUpgradeUUIDTest-2.0.exe installer should automatically
  34  * uninstall older version of the test application previously installed with
  35  * WinUpgradeUUIDTest-1.0.exe installer.
  36  */
  37 
  38 /*
  39  * @test
  40  * @summary jpackage with --win-upgrade-uuid and --app-version
  41  * @library ../helpers
  42  * @requires (os.family == "windows")
  43  * @modules jdk.jpackage/jdk.jpackage.internal
  44  * @run main/othervm -Xmx512m WinUpgradeUUIDTest
  45  */
  46 
  47 public class WinUpgradeUUIDTest {
  48     public static void main(String[] args) {

  49         PackageTest test = init();
  50         if (test.getAction() != PackageTest.Action.VERIFY_INSTALLED) {
  51             test.run();
  52         }
  53 
  54         test = init();
  55         test.addInitializer(cmd -> {
  56             cmd.setArgumentValue("--app-version", "2.0");
  57             cmd.setArgumentValue("--arguments", "bar");
  58         });
  59         test.run();

  60     }
  61 
  62     private static PackageTest init() {
  63         return new PackageTest()
  64         .forTypes(PackageType.WINDOWS)
  65         .configureHelloApp()
  66         .addInitializer(cmd -> cmd.addArguments("--win-upgrade-uuid",
  67                 "F0B18E75-52AD-41A2-BC86-6BE4FCD50BEB"));
  68     }
  69 }


   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  * Test both --win-upgrade-uuid and --app-version parameters. Output of the test
  30  * should be WinUpgradeUUIDTest-1.0.exe and WinUpgradeUUIDTest-2.0.exe
  31  * installers. Both output installers should provide the same functionality as
  32  * the default installer (see description of the default installer in
  33  * SimplePackageTest.java) but have the same product code and different
  34  * versions. Running WinUpgradeUUIDTest-2.0.exe installer should automatically
  35  * uninstall older version of the test application previously installed with
  36  * WinUpgradeUUIDTest-1.0.exe installer.
  37  */
  38 
  39 /*
  40  * @test
  41  * @summary jpackage with --win-upgrade-uuid and --app-version
  42  * @library ../helpers
  43  * @requires (os.family == "windows")
  44  * @modules jdk.jpackage/jdk.jpackage.internal
  45  * @run main/othervm/timeout=360 -Xmx512m WinUpgradeUUIDTest
  46  */
  47 
  48 public class WinUpgradeUUIDTest {
  49     public static void main(String[] args) {
  50         Test.run(args, () -> {
  51             PackageTest test = init();
  52             if (test.getAction() != PackageTest.Action.VERIFY_INSTALL) {
  53                 test.run();
  54             }
  55 
  56             test = init();
  57             test.addInitializer(cmd -> {
  58                 cmd.setArgumentValue("--app-version", "2.0");
  59                 cmd.setArgumentValue("--arguments", "bar");
  60             });
  61             test.run();
  62         });
  63     }
  64 
  65     private static PackageTest init() {
  66         return new PackageTest()
  67             .forTypes(PackageType.WINDOWS)
  68             .configureHelloApp()
  69             .addInitializer(cmd -> cmd.addArguments("--win-upgrade-uuid",
  70                     "F0B18E75-52AD-41A2-BC86-6BE4FCD50BEB"));
  71     }
  72 }
< prev index next >