test/jdk/tools/jpackage/share/AddLaunchersTest.java
author herrick
Tue, 10 Sep 2019 14:57:03 -0400
branchJDK-8200758-branch
changeset 58114 42df7de58e39
parent 57446 5a5b85f00a63
child 58147 45a9084fe981
permissions -rw-r--r--
8230519: jpackage "--package-type" values and default Reviewed-by: asemenyuk, almatvee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     1
/*
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     4
 *
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     7
 * published by the Free Software Foundation.
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     8
 *
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    13
 * accompanied this code).
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    14
 *
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    18
 *
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    21
 * questions.
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    22
 */
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    23
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    24
 /*
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    25
 * @test
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    26
 * @summary jpackage create image with additional launcher test
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    27
 * @library ../helpers
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    28
 * @build JPackageHelper
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    29
 * @build JPackagePath
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    30
 * @build AddLauncherBase
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    31
 * @modules jdk.jpackage
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    32
 * @run main/othervm -Xmx512m AddLaunchersTest
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    33
 */
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    34
public class AddLaunchersTest {
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    35
    private static final String OUTPUT = "output";
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    36
    private static final String [] CMD1 = {
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    37
        "--description", "Test non modular app with multiple add-launchers where one is modular app and other is non modular app",
58114
42df7de58e39 8230519: jpackage "--package-type" values and default
herrick
parents: 57446
diff changeset
    38
        "--package-type", "app-image",
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    39
        "--input", "input",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    40
        "--output", OUTPUT,
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    41
        "--name", "test",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    42
        "--main-jar", "hello.jar",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    43
        "--main-class", "Hello",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    44
        "--module-path", "module",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    45
        "--add-modules", "com.hello",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    46
        "--add-launcher", "test3=j1.properties",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    47
        "--add-launcher", "test4=m1.properties"};
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    48
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    49
    private static final String [] CMD2 = {
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    50
        "--description", "Test modular app with multiple add-launchers where one is modular app and other is non modular app",
58114
42df7de58e39 8230519: jpackage "--package-type" values and default
herrick
parents: 57446
diff changeset
    51
        "--package-type", "app-image",
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    52
        "--input", "input",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    53
        "--output", OUTPUT,
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    54
        "--name", "test",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    55
        "--module", "com.hello/com.hello.Hello",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    56
        "--module-path", "module",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    57
        "--add-launcher", "test5=jl.properties",
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    58
        "--add-launcher", "test6=m1.properties"};
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    59
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    60
    public static void main(String[] args) throws Exception {
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    61
        JPackageHelper.createHelloImageJar();
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    62
        JPackageHelper.createHelloModule();
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    63
        AddLauncherBase.createSLProperties();
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    64
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    65
        JPackageHelper.deleteOutputFolder(OUTPUT);
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    66
        AddLauncherBase.testCreateAppImageToolProvider(
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    67
                CMD1, false, "test3");
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    68
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    69
        JPackageHelper.deleteOutputFolder(OUTPUT);
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    70
        AddLauncherBase.testCreateAppImage(
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    71
                CMD1, false, "test4");
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    72
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    73
        JPackageHelper.deleteOutputFolder(OUTPUT);
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    74
        AddLauncherBase.testCreateAppImage(
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    75
                CMD2, false, "test5");
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    76
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    77
        JPackageHelper.deleteOutputFolder(OUTPUT);
57446
5a5b85f00a63 8226891: rename and re-layout jpackage tests.
herrick
parents: 57414
diff changeset
    78
        AddLauncherBase.testCreateAppImageToolProvider(
57395
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    79
                CMD2, false, "test6");
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    80
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    81
    }
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    82
521c02b9eed0 8224130: create additional automated tests for create-app-image
herrick
parents:
diff changeset
    83
}