< prev index next >

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

Print this page




  62     private static void testCreateInstaller() throws Exception {
  63         JPackageHelper.executeCLI(true, CMD);
  64         JPackageInstallerHelper.validateOutput(OUTPUT);
  65         validatePackage();
  66         copyResults();
  67     }
  68 
  69     private static void verifyInstall() throws Exception {
  70         String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
  71         JPackageInstallerHelper.validateApp(app);
  72     }
  73 
  74     private static void verifyUnInstall() throws Exception {
  75         String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
  76         File folder = new File(folderPath);
  77         if (folder.exists()) {
  78             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  79         }
  80     }
  81 
  82     private static void init(String name, String ext) {
  83         TEST_NAME = name;
  84         EMAIL = "jpackage-test@java.com";
  85         EXT = ext;
  86         OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  87         CMD = new String[]{
  88             "--package-type", EXT,
  89             "--input", "input",
  90             "--output", "output",
  91             "--name", TEST_NAME,
  92             "--main-jar", "hello.jar",
  93             "--main-class", "Hello",
  94             "--linux-deb-maintainer", EMAIL};
  95     }
  96 
  97     public static void run(String name, String ext) throws Exception {
  98         init(name, ext);
  99 
 100         if (JPackageInstallerHelper.isVerifyInstall()) {
 101             verifyInstall();
 102         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {


  62     private static void testCreateInstaller() throws Exception {
  63         JPackageHelper.executeCLI(true, CMD);
  64         JPackageInstallerHelper.validateOutput(OUTPUT);
  65         validatePackage();
  66         copyResults();
  67     }
  68 
  69     private static void verifyInstall() throws Exception {
  70         String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
  71         JPackageInstallerHelper.validateApp(app);
  72     }
  73 
  74     private static void verifyUnInstall() throws Exception {
  75         String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
  76         File folder = new File(folderPath);
  77         if (folder.exists()) {
  78             throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
  79         }
  80     }
  81 
  82     private static void init(String name, String ext) throws Exception {
  83         TEST_NAME = name;
  84         EMAIL = "jpackage-test@java.com";
  85         EXT = ext;
  86         OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
  87         CMD = new String[]{
  88             "--package-type", EXT,
  89             "--input", "input",
  90             "--output", "output",
  91             "--name", TEST_NAME,
  92             "--main-jar", "hello.jar",
  93             "--main-class", "Hello",
  94             "--linux-deb-maintainer", EMAIL};
  95     }
  96 
  97     public static void run(String name, String ext) throws Exception {
  98         init(name, ext);
  99 
 100         if (JPackageInstallerHelper.isVerifyInstall()) {
 101             verifyInstall();
 102         } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
< prev index next >