< prev index next >
test/jdk/tools/jpackage/createimage/JPackageCreateImageVersionTest.java
Print this page
*** 33,65 ****
* @build JPackagePath
* @modules jdk.jpackage
* @run main/othervm -Xmx512m JPackageCreateImageVersionTest
*/
public class JPackageCreateImageVersionTest {
private static final String appCfg = JPackagePath.getAppCfg();
private static final String VERSION = "2.3";
private static final String VERSION_DEFAULT = "1.0";
private static final String[] CMD = {
"create-image",
"--input", "input",
! "--output", "output",
"--name", "test",
"--main-jar", "hello.jar",
"--main-class", "Hello",
- "--overwrite",
"--files", "hello.jar"};
private static final String[] CMD_VERSION = {
"create-image",
"--input", "input",
! "--output", "output",
"--name", "test",
"--main-jar", "hello.jar",
"--main-class", "Hello",
"--files", "hello.jar",
- "--overwrite",
"--app-version", VERSION};
private static void validate(String version)
throws Exception {
File outfile = new File(appCfg);
--- 33,64 ----
* @build JPackagePath
* @modules jdk.jpackage
* @run main/othervm -Xmx512m JPackageCreateImageVersionTest
*/
public class JPackageCreateImageVersionTest {
+ private static final String OUTPUT = "output";
private static final String appCfg = JPackagePath.getAppCfg();
private static final String VERSION = "2.3";
private static final String VERSION_DEFAULT = "1.0";
private static final String[] CMD = {
"create-image",
"--input", "input",
! "--output", OUTPUT,
"--name", "test",
"--main-jar", "hello.jar",
"--main-class", "Hello",
"--files", "hello.jar"};
private static final String[] CMD_VERSION = {
"create-image",
"--input", "input",
! "--output", OUTPUT,
"--name", "test",
"--main-jar", "hello.jar",
"--main-class", "Hello",
"--files", "hello.jar",
"--app-version", VERSION};
private static void validate(String version)
throws Exception {
File outfile = new File(appCfg);
*** 80,96 ****
--- 79,98 ----
}
private static void testVersion() throws Exception {
JPackageHelper.executeCLI(true, CMD);
validate(null);
+ JPackageHelper.deleteOutputFolder(OUTPUT);
JPackageHelper.executeCLI(true, CMD_VERSION);
validate(VERSION);
}
private static void testVersionToolProvider() throws Exception {
+ JPackageHelper.deleteOutputFolder(OUTPUT);
JPackageHelper.executeToolProvider(true, CMD);
validate(null);
+ JPackageHelper.deleteOutputFolder(OUTPUT);
JPackageHelper.executeToolProvider(true, CMD_VERSION);
validate(VERSION);
}
public static void main(String[] args) throws Exception {
< prev index next >