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 "create-installer",
89 EXT,
90 "--input", "input",
91 "--output", "output",
92 "--name", TEST_NAME,
93 "--main-jar", "hello.jar",
94 "--main-class", "Hello",
95 "--overwrite",
96 "--files", "hello.jar",
97 "--linux-deb-maintainer", EMAIL};
98 }
99
100 public static void run(String name, String ext) throws Exception {
101 init(name, ext);
102
103 if (JPackageInstallerHelper.isVerifyInstall()) {
104 verifyInstall();
105 } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
106 verifyUnInstall();
107 } else {
108 JPackageHelper.createHelloInstallerJar();
109 testCreateInstaller();
110 }
111 }
112 }
|
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 "create-installer",
89 "--installer-type", EXT,
90 "--input", "input",
91 "--output", "output",
92 "--name", TEST_NAME,
93 "--main-jar", "hello.jar",
94 "--main-class", "Hello",
95 "--files", "hello.jar",
96 "--linux-deb-maintainer", EMAIL};
97 }
98
99 public static void run(String name, String ext) throws Exception {
100 init(name, ext);
101
102 if (JPackageInstallerHelper.isVerifyInstall()) {
103 verifyInstall();
104 } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
105 verifyUnInstall();
106 } else {
107 JPackageHelper.createHelloInstallerJar();
108 testCreateInstaller();
109 }
110 }
111 }
|