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