< prev index next >

test/jdk/tools/jpackage/windows/base/InstallDirBase.java

Print this page




  57     }
  58 
  59     private static void verifyUnInstall() throws Exception {
  60         String folderPath = JPackagePath.getWinInstallFolder(INSTALL_DIR);
  61         File folder = new File(folderPath);
  62         if (folder.exists()) {
  63             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  64         }
  65 
  66         // Validate start menu
  67         JPackageInstallerHelper.validateStartMenu("Unknown", TEST_NAME, false);
  68 
  69         // Validate desktop shortcut
  70         JPackageInstallerHelper.validateDesktopShortcut(TEST_NAME, false);
  71     }
  72 
  73     private static void init(String name, String ext) {
  74         TEST_NAME = name;
  75         EXT = ext;
  76         OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  77         INSTALL_DIR = "TestVendor\\JPackageCreateInstallerInstallDirTestDir";
  78         CMD = new String[]{
  79             "--package-type", EXT,
  80             "--input", "input",
  81             "--output", "output",
  82             "--name", TEST_NAME,
  83             "--main-jar", "hello.jar",
  84             "--main-class", "Hello",
  85             "--install-dir", INSTALL_DIR,
  86             "--win-shortcut"};
  87     }
  88 
  89     public static void run(String name, String ext) throws Exception {
  90         init(name, ext);
  91 
  92         if (JPackageInstallerHelper.isVerifyInstall()) {
  93             verifyInstall();
  94         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
  95             verifyUnInstall();
  96         } else {
  97             JPackageHelper.createHelloInstallerJar();


  57     }
  58 
  59     private static void verifyUnInstall() throws Exception {
  60         String folderPath = JPackagePath.getWinInstallFolder(INSTALL_DIR);
  61         File folder = new File(folderPath);
  62         if (folder.exists()) {
  63             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  64         }
  65 
  66         // Validate start menu
  67         JPackageInstallerHelper.validateStartMenu("Unknown", TEST_NAME, false);
  68 
  69         // Validate desktop shortcut
  70         JPackageInstallerHelper.validateDesktopShortcut(TEST_NAME, false);
  71     }
  72 
  73     private static void init(String name, String ext) {
  74         TEST_NAME = name;
  75         EXT = ext;
  76         OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  77         INSTALL_DIR = "TestVendor" + File.separator + TEST_NAME;
  78         CMD = new String[]{
  79             "--package-type", EXT,
  80             "--input", "input",
  81             "--output", "output",
  82             "--name", TEST_NAME,
  83             "--main-jar", "hello.jar",
  84             "--main-class", "Hello",
  85             "--install-dir", INSTALL_DIR,
  86             "--win-shortcut"};
  87     }
  88 
  89     public static void run(String name, String ext) throws Exception {
  90         init(name, ext);
  91 
  92         if (JPackageInstallerHelper.isVerifyInstall()) {
  93             verifyInstall();
  94         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
  95             verifyUnInstall();
  96         } else {
  97             JPackageHelper.createHelloInstallerJar();
< prev index next >