test/jdk/tools/jpackage/JPackageMissingArgumentsTest.java
branchJDK-8200758-branch
changeset 57307 4948a1944cf9
parent 57241 e11f3bf34083
child 57314 23da9e6f446f
equal deleted inserted replaced
57306:b3b59183df78 57307:4948a1944cf9
    32  */
    32  */
    33 
    33 
    34 public class JPackageMissingArgumentsTest {
    34 public class JPackageMissingArgumentsTest {
    35     private static final String [] RESULT_1 = {"--output"};
    35     private static final String [] RESULT_1 = {"--output"};
    36     private static final String [] CMD_1 = {
    36     private static final String [] CMD_1 = {
    37         "create-image",
    37         "create-app-image",
    38         "--input", "input",
    38         "--input", "input",
    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         "--files", "hello.jar"};
    42     };
    43 
    43 
    44     private static final String [] RESULT_2 = {"--input"};
    44     private static final String [] RESULT_2 = {"--input"};
    45     private static final String [] CMD_2 = {
    45     private static final String [] CMD_2 = {
    46         "create-image",
    46         "create-app-image",
    47         "--output", "output",
    47         "--output", "output",
    48         "--name", "test",
    48         "--name", "test",
    49         "--main-jar", "hello.jar",
    49         "--main-jar", "hello.jar",
    50         "--main-class", "Hello",
    50         "--main-class", "Hello",
    51         "--files", "hello.jar"};
    51     };
    52 
    52 
    53     private static final String [] RESULT_3 = {"--input", "--app-image"};
    53     private static final String [] RESULT_3 = {"--input", "--app-image"};
    54     private static final String [] CMD_3 = {
    54     private static final String [] CMD_3 = {
    55         "create-installer",
    55         "create-installer",
    56         "--output", "output",
    56         "--output", "output",
    57         "--name", "test",
    57         "--name", "test",
    58         "--main-jar", "hello.jar",
    58         "--main-jar", "hello.jar",
    59         "--main-class", "Hello",
    59         "--main-class", "Hello",
    60         "--files", "hello.jar"};
    60     };
    61 
    61 
    62     private static final String [] RESULT_4 = {"--main-class"};
    62     private static final String [] RESULT_4 = {"--main-class"};
    63     private static final String [] CMD_4 = {
    63     private static final String [] CMD_4 = {
    64         "create-image",
    64         "create-app-image",
    65         "--input", "input",
    65         "--input", "input",
    66         "--output", "output",
    66         "--output", "output",
    67         "--name", "test",
    67         "--name", "test",
    68         "--main-jar", "hello.jar",
    68         "--main-jar", "hello.jar",
    69         "--files", "hello.jar"};
    69     };
    70 
    70 
    71     private static final String [] RESULT_5 = {"--main-jar"};
    71     private static final String [] RESULT_5 = {"--main-jar"};
    72     private static final String [] CMD_5 = {
    72     private static final String [] CMD_5 = {
    73         "create-image",
    73         "create-app-image",
    74         "--input", "input",
    74         "--input", "input",
    75         "--output", "output",
    75         "--output", "output",
    76         "--name", "test",
    76         "--name", "test",
    77         "--main-class", "Hello",
    77         "--main-class", "Hello",
    78         "--files", "hello.jar"};
    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     private static final String [] CMD_6 = {
    81     private static final String [] CMD_6 = {
    82         "create-image",
    82         "create-app-image",
    83         "--output", "output",
    83         "--output", "output",
    84         "--name", "test",
    84         "--name", "test",
    85         "--module", "com.hello/com.hello.Hello",
    85         "--module", "com.hello/com.hello.Hello",
    86         "--files", "hello.jar"};
    86     };
    87 
    87 
    88     private static final String [] RESULT_7 = {"--module-path", "--runtime-image",
    88     private static final String [] RESULT_7 = {"--module-path", "--runtime-image",
    89                                                "--app-image"};
    89                                                "--app-image"};
    90     private static final String [] CMD_7 = {
    90     private static final String [] CMD_7 = {
    91         "create-installer",
    91         "create-installer",
    92         "--output", "output",
    92         "--output", "output",
    93         "--name", "test",
    93         "--name", "test",
    94         "--module", "com.hello/com.hello.Hello",
    94         "--module", "com.hello/com.hello.Hello",
    95         "--files", "hello.jar"};
    95     };
    96 
    96 
    97     private static void validate(String output, String [] expected)
    97     private static void validate(String output, String [] expected)
    98            throws Exception {
    98            throws Exception {
    99         String[] result = output.split("\n");
    99         String[] result = output.split("\n");
   100         if (result.length != 1) {
   100         if (result.length != 1) {