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 EXT = ext; 85 JP_LICENSE_TYPE = "JP_LICENSE_TYPE"; 86 if (EXT.equals("rpm")) { 87 OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT; 88 } else { 89 OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT; 90 } 91 CMD = new String[]{ 92 "--package-type", EXT, 93 "--input", "input", 94 "--output", "output", 95 "--name", TEST_NAME, 96 "--main-jar", "hello.jar", 97 "--main-class", "Hello", 98 "--linux-rpm-license-type", JP_LICENSE_TYPE}; 99 } 100 101 public static void run(String name, String ext) throws Exception { 102 init(name, ext); 103 104 if (JPackageInstallerHelper.isVerifyInstall()) { 105 verifyInstall(); 106 } else if (JPackageInstallerHelper.isVerifyUnInstall()) { 107 verifyUnInstall(); | 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 EXT = ext; 85 JP_LICENSE_TYPE = "JP_LICENSE_TYPE"; 86 if (EXT.equals("rpm")) { 87 OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1." + Base.getRpmArch() + "." + EXT; 88 } else { 89 OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT; 90 } 91 CMD = new String[]{ 92 "--package-type", EXT, 93 "--input", "input", 94 "--output", "output", 95 "--name", TEST_NAME, 96 "--main-jar", "hello.jar", 97 "--main-class", "Hello", 98 "--linux-rpm-license-type", JP_LICENSE_TYPE}; 99 } 100 101 public static void run(String name, String ext) throws Exception { 102 init(name, ext); 103 104 if (JPackageInstallerHelper.isVerifyInstall()) { 105 verifyInstall(); 106 } else if (JPackageInstallerHelper.isVerifyUnInstall()) { 107 verifyUnInstall(); |