< prev index next >

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

Print this page




  46 
  47     private static void verifyInstall() throws Exception {
  48         String app = JPackagePath.getLinuxInstalledApp("jpackage", TEST_NAME);
  49         JPackageInstallerHelper.validateApp(app);
  50     }
  51 
  52     private static void verifyUnInstall() throws Exception {
  53         String folderPath = JPackagePath.getLinuxInstallFolder("jpackage", TEST_NAME);
  54         File folder = new File(folderPath);
  55         if (folder.exists()) {
  56             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  57         }
  58 
  59         folderPath = JPackagePath.getLinuxInstallFolder("jpackage", null);
  60         folder = new File(folderPath);
  61         if (folder.exists()) {
  62             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  63         }
  64     }
  65 
  66     private static void init(String name, String ext) {
  67         TEST_NAME = name;
  68         EXT = ext;
  69         if (EXT.equals("rpm")) {
  70             OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
  71         } else {
  72             OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  73         }
  74         CMD = new String[]{
  75             "--package-type", EXT,
  76             "--input", "input",
  77             "--output", "output",
  78             "--name", TEST_NAME,
  79             "--main-jar", "hello.jar",
  80             "--main-class", "Hello",
  81             "--install-dir", "/opt/jpackage"};
  82     }
  83 
  84     public static void run(String name, String ext) throws Exception {
  85         init(name, ext);
  86 
  87         if (JPackageInstallerHelper.isVerifyInstall()) {
  88             verifyInstall();
  89         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
  90             verifyUnInstall();


  46 
  47     private static void verifyInstall() throws Exception {
  48         String app = JPackagePath.getLinuxInstalledApp("jpackage", TEST_NAME);
  49         JPackageInstallerHelper.validateApp(app);
  50     }
  51 
  52     private static void verifyUnInstall() throws Exception {
  53         String folderPath = JPackagePath.getLinuxInstallFolder("jpackage", TEST_NAME);
  54         File folder = new File(folderPath);
  55         if (folder.exists()) {
  56             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  57         }
  58 
  59         folderPath = JPackagePath.getLinuxInstallFolder("jpackage", null);
  60         folder = new File(folderPath);
  61         if (folder.exists()) {
  62             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  63         }
  64     }
  65 
  66     private static void init(String name, String ext) throws Exception {
  67         TEST_NAME = name;
  68         EXT = ext;
  69         if (EXT.equals("rpm")) {
  70             OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1." + Base.getRpmArch() + "." + EXT;
  71         } else {
  72             OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  73         }
  74         CMD = new String[]{
  75             "--package-type", EXT,
  76             "--input", "input",
  77             "--output", "output",
  78             "--name", TEST_NAME,
  79             "--main-jar", "hello.jar",
  80             "--main-class", "Hello",
  81             "--install-dir", "/opt/jpackage"};
  82     }
  83 
  84     public static void run(String name, String ext) throws Exception {
  85         init(name, ext);
  86 
  87         if (JPackageInstallerHelper.isVerifyInstall()) {
  88             verifyInstall();
  89         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
  90             verifyUnInstall();
< prev index next >