test/jdk/tools/jpackage/createimage/JPackageCreateImageIconTest.java
branchJDK-8200758-branch
changeset 57241 e11f3bf34083
parent 57150 fa68c2ab636d
equal deleted inserted replaced
57220:6a80fd1912ef 57241:e11f3bf34083
    32  * @build JPackagePath
    32  * @build JPackagePath
    33  * @modules jdk.jpackage
    33  * @modules jdk.jpackage
    34  * @run main/othervm -Xmx512m JPackageCreateImageIconTest
    34  * @run main/othervm -Xmx512m JPackageCreateImageIconTest
    35  */
    35  */
    36 public class JPackageCreateImageIconTest {
    36 public class JPackageCreateImageIconTest {
       
    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         "--name", "test",
    45         "--name", "test",
    45         "--main-jar", "hello.jar",
    46         "--main-jar", "hello.jar",
    46         "--main-class", "Hello",
    47         "--main-class", "Hello",
    47         "--overwrite",
       
    48         "--files", "hello.jar",
    48         "--files", "hello.jar",
    49         "--icon", getIconPath(),
    49         "--icon", getIconPath(),
    50         "--output", "output"};
    50         "--output", OUTPUT};
    51 
    51 
    52     private static void validateResult(String[] result) throws Exception {
    52     private static void validateResult(String[] result) throws Exception {
    53         if (result.length != 2) {
    53         if (result.length != 2) {
    54             throw new AssertionError(
    54             throw new AssertionError(
    55                    "Unexpected number of lines: " + result.length);
    55                    "Unexpected number of lines: " + result.length);
    96         validate();
    96         validate();
    97         validateIcon();
    97         validateIcon();
    98     }
    98     }
    99 
    99 
   100     private static void testIconToolProvider() throws Exception {
   100     private static void testIconToolProvider() throws Exception {
       
   101         JPackageHelper.deleteOutputFolder(OUTPUT);
   101         JPackageHelper.executeToolProvider(true, CMD);
   102         JPackageHelper.executeToolProvider(true, CMD);
   102         validate();
   103         validate();
   103         validateIcon();
   104         validateIcon();
   104     }
   105     }
   105 
   106