test/jdk/tools/jpackage/share/MissingArgumentsTest.java
branchJDK-8200758-branch
changeset 58993 b5e1baa9d2c3
parent 58147 45a9084fe981
child 58994 b09ba68c6a19
equal deleted inserted replaced
58992:7249e95cc439 58993:b5e1baa9d2c3
    32  */
    32  */
    33 
    33 
    34 public class MissingArgumentsTest {
    34 public class MissingArgumentsTest {
    35     private static final String [] RESULT_1 = {"--input"};
    35     private static final String [] RESULT_1 = {"--input"};
    36     private static final String [] CMD_1 = {
    36     private static final String [] CMD_1 = {
    37         "--package-type", "app-image",
    37         "--type", "app-image",
    38         "--dest", "output",
    38         "--dest", "output",
    39         "--name", "test",
    39         "--name", "test",
    40         "--main-jar", "hello.jar",
    40         "--main-jar", "hello.jar",
    41         "--main-class", "Hello",
    41         "--main-class", "Hello",
    42     };
    42     };
    43 
    43 
    44     private static final String [] RESULT_2 = {"--input", "--app-image"};
    44     private static final String [] RESULT_2 = {"--input", "--app-image"};
    45     private static final String [] CMD_2 = {
    45     private static final String [] CMD_2 = {
    46         "--package-type", "app-image",
    46         "--type", "app-image",
    47         "--package-type", "invalid-package-type",
    47         "--type", "invalid-type",
    48         "--dest", "output",
    48         "--dest", "output",
    49         "--name", "test",
    49         "--name", "test",
    50         "--main-jar", "hello.jar",
    50         "--main-jar", "hello.jar",
    51         "--main-class", "Hello",
    51         "--main-class", "Hello",
    52     };
    52     };
    53 
    53 
    54     private static final String [] RESULT_3 = {"main class was not specified"};
    54     private static final String [] RESULT_3 = {"main class was not specified"};
    55     private static final String [] CMD_3 = {
    55     private static final String [] CMD_3 = {
    56         "--package-type", "app-image",
    56         "--type", "app-image",
    57         "--input", "input",
    57         "--input", "input",
    58         "--dest", "output",
    58         "--dest", "output",
    59         "--name", "test",
    59         "--name", "test",
    60         "--main-jar", "hello.jar",
    60         "--main-jar", "hello.jar",
    61     };
    61     };
    62 
    62 
    63     private static final String [] RESULT_4 = {"--main-jar"};
    63     private static final String [] RESULT_4 = {"--main-jar"};
    64     private static final String [] CMD_4 = {
    64     private static final String [] CMD_4 = {
    65         "--package-type", "app-image",
    65         "--type", "app-image",
    66         "--input", "input",
    66         "--input", "input",
    67         "--dest", "output",
    67         "--dest", "output",
    68         "--name", "test",
    68         "--name", "test",
    69         "--main-class", "Hello",
    69         "--main-class", "Hello",
    70     };
    70     };
    71 
    71 
    72     private static final String [] RESULT_5 = {"--module-path", "--runtime-image"};
    72     private static final String [] RESULT_5 = {"--module-path", "--runtime-image"};
    73     private static final String [] CMD_5 = {
    73     private static final String [] CMD_5 = {
    74         "--package-type", "app-image",
    74         "--type", "app-image",
    75         "--dest", "output",
    75         "--dest", "output",
    76         "--name", "test",
    76         "--name", "test",
    77         "--module", "com.hello/com.hello.Hello",
    77         "--module", "com.hello/com.hello.Hello",
    78     };
    78     };
    79 
    79 
    80     private static final String [] RESULT_6 = {"--module-path", "--runtime-image",
    80     private static final String [] RESULT_6 = {"--module-path", "--runtime-image",
    81                                                "--app-image"};
    81                                                "--app-image"};
    82     private static final String [] CMD_6 = {
    82     private static final String [] CMD_6 = {
    83         "--package-type", "invalid-package-type",
    83         "--type", "invalid-type",
    84         "--dest", "output",
    84         "--dest", "output",
    85         "--name", "test",
    85         "--name", "test",
    86         "--module", "com.hello/com.hello.Hello",
    86         "--module", "com.hello/com.hello.Hello",
    87     };
    87     };
    88 
    88