32 * @build JPackagePath |
32 * @build JPackagePath |
33 * @modules jdk.jpackage |
33 * @modules jdk.jpackage |
34 * @run main/othervm -Xmx512m JPackageCreateImageMainClassAttributeTest |
34 * @run main/othervm -Xmx512m JPackageCreateImageMainClassAttributeTest |
35 */ |
35 */ |
36 public class JPackageCreateImageMainClassAttributeTest { |
36 public class JPackageCreateImageMainClassAttributeTest { |
|
37 private static final String OUTPUT = "output"; |
37 private static final String app = JPackagePath.getApp(); |
38 private static final String app = JPackagePath.getApp(); |
38 private static final String appOutput = JPackagePath.getAppOutputFile(); |
39 private static final String appOutput = JPackagePath.getAppOutputFile(); |
39 private static final String appWorkingDir = JPackagePath.getAppWorkingDir(); |
40 private static final String appWorkingDir = JPackagePath.getAppWorkingDir(); |
40 |
41 |
41 private static final String[] CMD = { |
42 private static final String[] CMD = { |
42 "create-image", |
43 "create-image", |
43 "--input", "input", |
44 "--input", "input", |
44 "--output", "output", |
45 "--output", OUTPUT, |
45 "--name", "test", |
46 "--name", "test", |
46 "--main-jar", "hello.jar", |
47 "--main-jar", "hello.jar", |
47 "--overwrite", |
|
48 "--files", "hello.jar"}; |
48 "--files", "hello.jar"}; |
49 |
49 |
50 private static void validateResult(String[] result) throws Exception { |
50 private static void validateResult(String[] result) throws Exception { |
51 if (result.length != 2) { |
51 if (result.length != 2) { |
52 throw new AssertionError( |
52 throw new AssertionError( |
83 JPackageHelper.executeCLI(true, CMD); |
83 JPackageHelper.executeCLI(true, CMD); |
84 validate(); |
84 validate(); |
85 } |
85 } |
86 |
86 |
87 private static void testMainClassAttributeToolProvider() throws Exception { |
87 private static void testMainClassAttributeToolProvider() throws Exception { |
|
88 JPackageHelper.deleteOutputFolder(OUTPUT); |
88 JPackageHelper.executeToolProvider(true, CMD); |
89 JPackageHelper.executeToolProvider(true, CMD); |
89 validate(); |
90 validate(); |
90 } |
91 } |
91 |
92 |
92 public static void main(String[] args) throws Exception { |
93 public static void main(String[] args) throws Exception { |