< prev index next >

test/jdk/tools/jpackage/createinstaller/windows/base/JPackageCreateInstallerWinUpgradeUUIDBase.java

Print this page




  85     private static void verifyUnInstall() throws Exception {
  86         String folderPath = JPackagePath.getWinInstallFolder(TEST_NAME);
  87         File folder = new File(folderPath);
  88         if (folder.exists()) {
  89             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  90         }
  91     }
  92 
  93     private static void init(String name, String ext) {
  94         TEST_NAME = name;
  95         EXT = ext;
  96         OUTPUT_1 = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  97         CMD_1 = new String[]{
  98             "create-installer",
  99             "--installer-type", EXT,
 100             "--input", "input",
 101             "--output", "output",
 102             "--name", TEST_NAME,
 103             "--main-jar", "hello.jar",
 104             "--main-class", "Hello",
 105             "--overwrite",
 106             "--files", "hello.jar" + File.pathSeparator + FILE_1,
 107             "--app-version", "1.0",
 108             "--win-upgrade-uuid", "F0B18E75-52AD-41A2-BC86-6BE4FCD50BEB"};
 109         OUTPUT_2 = "output" + File.separator + TEST_NAME + "-2.0." + EXT;
 110         CMD_2 = new String[]{
 111             "create-installer",
 112             "--installer-type", EXT,
 113             "--input", "input",
 114             "--output", "output",
 115             "--name", TEST_NAME,
 116             "--main-jar", "hello.jar",
 117             "--main-class", "Hello",
 118             "--overwrite",
 119             "--files", "hello.jar" + File.pathSeparator + FILE_2,
 120             "--app-version", "2.0",
 121             "--win-upgrade-uuid", "F0B18E75-52AD-41A2-BC86-6BE4FCD50BEB"};
 122     }
 123 
 124     private static void createInputFile(String name, String context) throws Exception {
 125         try (PrintWriter out = new PrintWriter(
 126                 new BufferedWriter(new FileWriter("input" + File.separator + name)))) {
 127             out.println(context);
 128         }
 129     }
 130 
 131     public static void run(String name, String ext) throws Exception {
 132         init(name, ext);
 133 
 134         if (JPackageInstallerHelper.isVerifyInstall()) {
 135             verifyInstall();
 136         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
 137             verifyUnInstall();
 138         } else {


  85     private static void verifyUnInstall() throws Exception {
  86         String folderPath = JPackagePath.getWinInstallFolder(TEST_NAME);
  87         File folder = new File(folderPath);
  88         if (folder.exists()) {
  89             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  90         }
  91     }
  92 
  93     private static void init(String name, String ext) {
  94         TEST_NAME = name;
  95         EXT = ext;
  96         OUTPUT_1 = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  97         CMD_1 = new String[]{
  98             "create-installer",
  99             "--installer-type", EXT,
 100             "--input", "input",
 101             "--output", "output",
 102             "--name", TEST_NAME,
 103             "--main-jar", "hello.jar",
 104             "--main-class", "Hello",

 105             "--files", "hello.jar" + File.pathSeparator + FILE_1,
 106             "--app-version", "1.0",
 107             "--win-upgrade-uuid", "F0B18E75-52AD-41A2-BC86-6BE4FCD50BEB"};
 108         OUTPUT_2 = "output" + File.separator + TEST_NAME + "-2.0." + EXT;
 109         CMD_2 = new String[]{
 110             "create-installer",
 111             "--installer-type", EXT,
 112             "--input", "input",
 113             "--output", "output",
 114             "--name", TEST_NAME,
 115             "--main-jar", "hello.jar",
 116             "--main-class", "Hello",

 117             "--files", "hello.jar" + File.pathSeparator + FILE_2,
 118             "--app-version", "2.0",
 119             "--win-upgrade-uuid", "F0B18E75-52AD-41A2-BC86-6BE4FCD50BEB"};
 120     }
 121 
 122     private static void createInputFile(String name, String context) throws Exception {
 123         try (PrintWriter out = new PrintWriter(
 124                 new BufferedWriter(new FileWriter("input" + File.separator + name)))) {
 125             out.println(context);
 126         }
 127     }
 128 
 129     public static void run(String name, String ext) throws Exception {
 130         init(name, ext);
 131 
 132         if (JPackageInstallerHelper.isVerifyInstall()) {
 133             verifyInstall();
 134         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
 135             verifyUnInstall();
 136         } else {
< prev index next >