jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java
author naoto
Mon, 18 Jul 2016 11:22:53 -0700
changeset 39734 7701942a1e7b
parent 39051 1b0204c55914
child 40813 dd5aa9c67561
permissions -rw-r--r--
8159214: jlink --include-locales problems Reviewed-by: jlaskey, okutsu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * accompanied this code).
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * questions.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    23
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    24
import java.nio.file.Path;
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    25
import java.util.Arrays;
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    26
import java.util.ArrayList;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    27
import java.util.List;
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    28
import java.util.Locale;
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    29
import java.util.stream.Collectors;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    30
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    31
import jdk.tools.jlink.plugin.Plugin;
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    32
import jdk.tools.jlink.plugin.PluginException;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    33
import jdk.tools.jlink.internal.PluginRepository;
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    34
import jdk.tools.jlink.internal.TaskHelper;
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    35
import jdk.tools.jlink.internal.plugins.PluginsResourceBundle;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    36
import tests.Helper;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    37
import tests.JImageGenerator;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    38
import tests.JImageValidator;
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    39
import tests.Result;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    40
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    41
/*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    42
 * @test
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
    43
 * @bug 8152143 8152704 8155649
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    44
 * @summary IncludeLocalesPlugin tests
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    45
 * @author Naoto Sato
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    46
 * @library ../../lib
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    47
 * @modules java.base/jdk.internal.jimage
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    48
 *          jdk.jdeps/com.sun.tools.classfile
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    49
 *          jdk.jlink/jdk.tools.jlink.internal
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    50
 *          jdk.jlink/jdk.tools.jlink.internal.plugins
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    51
 *          jdk.jlink/jdk.tools.jmod
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    52
 *          jdk.jlink/jdk.tools.jimage
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    53
 *          jdk.compiler
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    54
 * @build tests.*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    55
 * @build tools.jlink.plugins.GetAvailableLocales
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    56
 * @run main/othervm -Xmx1g IncludeLocalesPluginTest
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    57
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    58
public class IncludeLocalesPluginTest {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    59
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    60
    private final static String moduleName = "IncludeLocalesTest";
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    61
    private static Helper helper;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    62
    private final static int INCLUDE_LOCALES_OPTION = 0;
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
    63
    private final static int ADDMODS_OPTION         = 1;
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
    64
    private final static int EXPECTED_LOCATIONS     = 2;
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
    65
    private final static int UNEXPECTED_PATHS       = 3;
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
    66
    private final static int AVAILABLE_LOCALES      = 4;
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
    67
    private final static int ERROR_MESSAGE          = 5;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    68
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    69
    private static int errors;
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    70
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    71
    private final static Object[][] testData = {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    72
        // without --include-locales option: should include all locales
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    73
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    74
            "",
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
    75
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    76
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    77
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    78
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    79
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    80
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    81
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    82
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    83
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    84
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    85
            List.of(),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    86
            Arrays.stream(Locale.getAvailableLocales())
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    87
                  // "(root)" for Locale.ROOT rather than ""
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    88
                  .map(loc -> loc.equals(Locale.ROOT) ? "(root)" : loc.toString())
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
    89
                  .collect(Collectors.toList()),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    90
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    91
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    92
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
    93
        // Asterisk works exactly the same as above
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
    94
        {
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
    95
            "*",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
    96
            "jdk.localedata",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
    97
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
    98
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
    99
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   100
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   101
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   102
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   103
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   104
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   105
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   106
            List.of(),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   107
            Arrays.stream(Locale.getAvailableLocales())
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   108
                  // "(root)" for Locale.ROOT rather than ""
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   109
                  .map(loc -> loc.equals(Locale.ROOT) ? "(root)" : loc.toString())
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   110
                  .collect(Collectors.toList()),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   111
            "",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   112
        },
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   113
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   114
        // World English/Spanish in Latin America
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   115
        {
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   116
            "--include-locales=en-001,es-419",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   117
            "jdk.localedata",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   118
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   119
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_AU.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   120
                "/jdk.localedata/sun/text/resources/ext/FormatData_es.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   121
                "/jdk.localedata/sun/text/resources/ext/FormatData_es_AR.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   122
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   123
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_150.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   124
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_AT.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   125
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_es.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   126
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_es_419.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   127
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_es_AR.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   128
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   129
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   130
                "/jdk.localedata/sun/text/resources/thai_dict",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   131
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   132
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   133
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   134
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   135
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   136
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   137
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   138
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   139
                "(root)", "en", "en_US", "en_US_POSIX", "en_001", "en_150", "en_AG", "en_AI",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   140
                "en_AT", "en_AU", "en_BB", "en_BE", "en_BM", "en_BS", "en_BW", "en_BZ",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   141
                "en_CA", "en_CC", "en_CH", "en_CK", "en_CM", "en_CX", "en_CY", "en_DE",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   142
                "en_DG", "en_DK", "en_DM", "en_ER", "en_FI", "en_FJ", "en_FK", "en_FM",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   143
                "en_GB", "en_GD", "en_GG", "en_GH", "en_GI", "en_GM", "en_GY", "en_HK",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   144
                "en_IE", "en_IL", "en_IM", "en_IN", "en_IO", "en_JE", "en_JM", "en_KE",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   145
                "en_KI", "en_KN", "en_KY", "en_LC", "en_LR", "en_LS", "en_MG", "en_MO",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   146
                "en_MS", "en_MT", "en_MU", "en_MW", "en_MY", "en_NA", "en_NF", "en_NG",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   147
                "en_NL", "en_NR", "en_NU", "en_NZ", "en_PG", "en_PH", "en_PK", "en_PN",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   148
                "en_PW", "en_RW", "en_SB", "en_SC", "en_SD", "en_SE", "en_SG", "en_SH",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   149
                "en_SI", "en_SL", "en_SS", "en_SX", "en_SZ", "en_TC", "en_TK", "en_TO",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   150
                "en_TT", "en_TV", "en_TZ", "en_UG", "en_VC", "en_VG", "en_VU", "en_WS",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   151
                "en_ZA", "en_ZM", "en_ZW", "es", "es_419", "es_AR", "es_BO", "es_BR",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   152
                "es_CL", "es_CO", "es_CR", "es_CU", "es_DO", "es_EC", "es_GT", "es_HN",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   153
                "es_MX", "es_NI", "es_PA", "es_PE", "es_PR", "es_PY", "es_SV", "es_US",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   154
                "es_UY", "es_VE"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   155
            "",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   156
        },
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   157
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   158
        // All English and Japanese locales
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   159
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   160
            "--include-locales=en,ja",
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   161
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   162
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   163
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   164
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   165
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   166
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   167
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   168
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   169
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   170
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   171
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   172
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   173
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   174
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   175
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   176
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   177
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   178
                "(root)", "en", "en_001", "en_150", "en_AG", "en_AI", "en_AS", "en_AT",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   179
                "en_AU", "en_BB", "en_BE", "en_BI", "en_BM", "en_BS", "en_BW", "en_BZ",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   180
                "en_CA", "en_CC", "en_CH", "en_CK", "en_CM", "en_CX", "en_CY", "en_DE",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   181
                "en_DG", "en_DK", "en_DM", "en_ER", "en_FI", "en_FJ", "en_FK", "en_FM",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   182
                "en_GB", "en_GD", "en_GG", "en_GH", "en_GI", "en_GM", "en_GU", "en_GY",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   183
                "en_HK", "en_IE", "en_IL", "en_IM", "en_IN", "en_IO", "en_JE", "en_JM",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   184
                "en_KE", "en_KI", "en_KN", "en_KY", "en_LC", "en_LR", "en_LS", "en_MG",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   185
                "en_MH", "en_MO", "en_MP", "en_MS", "en_MT", "en_MU", "en_MW", "en_MY",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   186
                "en_NA", "en_NF", "en_NG", "en_NL", "en_NR", "en_NU", "en_NZ", "en_PG",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   187
                "en_PH", "en_PK", "en_PN", "en_PR", "en_PW", "en_RW", "en_SB", "en_SC",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   188
                "en_SD", "en_SE", "en_SG", "en_SH", "en_SI", "en_SL", "en_SS", "en_SX",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   189
                "en_SZ", "en_TC", "en_TK", "en_TO", "en_TT", "en_TV", "en_TZ", "en_UG",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   190
                "en_UM", "en_US", "en_US_POSIX", "en_VC", "en_VG", "en_VI", "en_VU",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   191
                "en_WS", "en_ZA", "en_ZM", "en_ZW", "ja", "ja_JP",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   192
                "ja_JP_JP_#u-ca-japanese"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   193
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   194
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   195
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   196
        // All locales in Austria
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   197
        {
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   198
            "--include-locales=*-AT",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   199
            "jdk.localedata",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   200
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   201
                "/jdk.localedata/sun/text/resources/ext/FormatData_de.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   202
                "/jdk.localedata/sun/text/resources/ext/FormatData_de_AT.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   203
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_de.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   204
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_de_AT.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   205
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   206
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_150.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   207
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_AT.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   208
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   209
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   210
                "/jdk.localedata/sun/text/resources/thai_dict",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   211
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   212
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   213
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   214
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   215
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   216
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   217
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   218
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   219
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   220
                "(root)", "en", "en_US", "en_US_POSIX", "en_001", "en_150", "en_AT",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   221
                "de", "de_AT"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   222
            "",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   223
        },
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   224
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   225
        // All locales in India
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   226
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   227
            "--include-locales=*-IN",
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   228
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   229
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   230
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   231
                "/jdk.localedata/sun/text/resources/ext/FormatData_hi_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   232
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_as_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   233
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   234
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   235
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_kok_IN.class",
38747
469920616f3a 8145136: Upgrade CLDR locale data
rgoel
parents: 37790
diff changeset
   236
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_pa_Guru_IN.class"),
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   237
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   238
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   239
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   240
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   241
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   242
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   243
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   244
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   245
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   246
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   247
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   248
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   249
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   250
            List.of(
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   251
                "(root)", "as_IN", "as", "bn_IN", "bn", "bo_IN", "bo", "brx_IN", "brx",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   252
                "en", "en_001", "en_IN", "en_US", "en_US_POSIX", "gu_IN", "gu", "hi_IN",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   253
                "hi", "kn_IN", "kn", "kok_IN", "kok", "ks_IN", "ks", "ml_IN", "ml",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   254
                "mr_IN", "mr", "ne_IN", "ne", "or_IN", "or", "pa_IN", "pa", "pa_IN_#Guru",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   255
                "pa__#Guru", "ta_IN", "ta", "te_IN", "te", "ur_IN", "ur"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   256
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   257
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   258
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   259
        // Thai
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   260
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   261
            "--include-locales=th",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   262
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   263
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   264
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   265
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   266
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   267
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   268
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   269
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   270
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   271
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   272
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   273
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   274
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   275
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   276
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   277
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   278
                "(root)", "en", "en_US", "en_US_POSIX", "th", "th_TH",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   279
                "th_TH_TH_#u-nu-thai"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   280
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   281
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   282
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   283
        // Hong Kong
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   284
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   285
            "--include-locales=zh-HK",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   286
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   287
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   288
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   289
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_HK.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   290
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_TW.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   291
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   292
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   293
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   294
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   295
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   296
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   297
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   298
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   299
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   300
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   301
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_CN.class",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   302
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   303
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   304
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   305
            List.of(
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   306
                "(root)", "en", "en_US", "en_US_POSIX", "zh", "zh__#Hans", "zh__#Hant",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   307
                "zh_HK", "zh_HK_#Hans", "zh_HK_#Hant"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   308
            "",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   309
        },
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   310
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   311
        // Simplified Chinese
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   312
        {
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   313
            "--include-locales=zh-Hans",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   314
            "jdk.localedata",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   315
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   316
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   317
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_CN.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   318
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_SG.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   319
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   320
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   321
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   322
                "/jdk.localedata/sun/text/resources/thai_dict",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   323
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   324
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   325
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   326
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   327
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   328
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   329
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   330
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   331
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   332
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   333
                "(root)", "en", "en_US", "en_US_POSIX", "zh", "zh__#Hans", "zh_CN",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   334
                "zh_CN_#Hans", "zh_HK_#Hans", "zh_MO_#Hans", "zh_SG", "zh_SG_#Hans"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   335
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   336
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   337
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   338
        // Norwegian
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   339
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   340
            "--include-locales=nb,nn,no",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   341
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   342
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   343
                "/jdk.localedata/sun/text/resources/ext/FormatData_no.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   344
                "/jdk.localedata/sun/text/resources/ext/FormatData_no_NO.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   345
                "/jdk.localedata/sun/text/resources/ext/FormatData_no_NO_NY.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   346
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_nb.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   347
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_nn.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   348
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   349
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   350
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   351
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   352
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   353
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   354
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   355
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   356
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   357
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   358
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   359
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   360
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   361
                "(root)", "en", "en_US", "en_US_POSIX", "nb", "nb_NO", "nb_SJ", "nn",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   362
                "nn_NO", "no", "no_NO", "no_NO_NY"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   363
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   364
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   365
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   366
        // Hebrew/Indonesian/Yiddish
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   367
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   368
            "--include-locales=he,id,yi",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   369
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   370
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   371
                "/jdk.localedata/sun/text/resources/ext/FormatData_in.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   372
                "/jdk.localedata/sun/text/resources/ext/FormatData_in_ID.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   373
                "/jdk.localedata/sun/text/resources/ext/FormatData_iw.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   374
                "/jdk.localedata/sun/text/resources/ext/FormatData_iw_IL.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   375
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_in.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   376
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_iw.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   377
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ji.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   378
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   379
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   380
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   381
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   382
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   383
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   384
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   385
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   386
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   387
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   388
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   389
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   390
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   391
                "(root)", "en", "en_US", "en_US_POSIX", "in", "in_ID", "iw", "iw_IL",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   392
                "ji", "ji_001"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   393
            "",
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   394
        },
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   395
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   396
        // Error case: No matching locales
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   397
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   398
            "--include-locales=xyz",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   399
            "jdk.localedata",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   400
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   401
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   402
            null,
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   403
            new PluginException(String.format(
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   404
                PluginsResourceBundle.getMessage("include-locales.nomatchinglocales"), "xyz"))
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   405
                .getMessage(),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   406
        },
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   407
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   408
        // Error case: Invalid argument
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   409
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   410
            "--include-locales=en,zh_HK",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   411
            "jdk.localedata",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   412
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   413
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   414
            null,
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   415
            new PluginException(String.format(
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   416
                PluginsResourceBundle.getMessage("include-locales.invalidtag"), "zh_hk"))
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   417
                .getMessage(),
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   418
        },
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   419
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   420
        // Error case: jdk.localedata is not added
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   421
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   422
            "--include-locales=en-US",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   423
            "java.base",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   424
            null,
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   425
            null,
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   426
            null,
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   427
            new PluginException(
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   428
                PluginsResourceBundle.getMessage("include-locales.localedatanotfound"))
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   429
                .getMessage(),
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   430
        },
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   431
    };
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   432
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   433
    public static void main(String[] args) throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   434
        helper = Helper.newHelper();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   435
        if (helper == null) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   436
            System.err.println("Test not run");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   437
            return;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   438
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   439
        helper.generateDefaultModules();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   440
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   441
        for (Object[] data : testData) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   442
            // create image for each test data
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   443
            System.out.println("Invoking jlink with \"" + data[INCLUDE_LOCALES_OPTION] + "\"");
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   444
            Result result = JImageGenerator.getJLinkTask()
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   445
                    .modulePath(helper.defaultModulePath())
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   446
                    .output(helper.createNewImageDir(moduleName))
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   447
                    .addMods((String) data[ADDMODS_OPTION])
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   448
                    .option((String) data[INCLUDE_LOCALES_OPTION])
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   449
                    .call();
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   450
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   451
            String errorMsg = (String) data[ERROR_MESSAGE];
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   452
            if (errorMsg.isEmpty()) {
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   453
                Path image = result.assertSuccess();
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   454
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   455
                // test locale data entries
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   456
                testLocaleDataEntries(image,
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   457
                    (List<String>) data[EXPECTED_LOCATIONS],
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   458
                    (List<String>) data[UNEXPECTED_PATHS]);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   459
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   460
                // test available locales
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   461
                testAvailableLocales(image, (List<String>) data[AVAILABLE_LOCALES]);
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   462
            } else {
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   463
                result.assertFailure(new TaskHelper(TaskHelper.JLINK_BUNDLE)
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   464
                    .getMessage("error.prefix") + " " +errorMsg);
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   465
                System.out.println("\tExpected failure: " + result.getMessage());
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   466
            }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   467
        }
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   468
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   469
        if (errors > 0) {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   470
            throw new RuntimeException("Test failed");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   471
        }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   472
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   473
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   474
    private static void testLocaleDataEntries(Path image, List<String> expectedLocations,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   475
                        List<String> unexpectedPaths) throws Exception {
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   476
        System.out.println("testLocaleDataEntries:");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   477
        try {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   478
            JImageValidator.validate(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   479
                image.resolve("lib").resolve("modules"),
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   480
                expectedLocations, unexpectedPaths);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   481
        } catch (Exception e) {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   482
            System.out.println("\tFailed with: " + e);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   483
            e.printStackTrace();
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   484
            errors++;
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   485
        }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   486
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   487
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   488
    private static void testAvailableLocales(Path image, List<String> availableLocales) throws Exception {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   489
        System.out.println("testAvailableLocales:");
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   490
        Path launcher = image.resolve("bin/java" +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   491
            (System.getProperty("os.name").startsWith("Windows") ? ".exe" : ""));
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   492
        List<String> args = new ArrayList<>(availableLocales.size() + 2);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   493
        args.add(launcher.toString());
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   494
        args.add("GetAvailableLocales");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   495
        args.addAll(availableLocales);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   496
        Process proc = new ProcessBuilder(args).inheritIO().start();
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   497
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   498
        int len = Math.min(10, args.size());
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   499
        String command = args.subList(0, len).stream().collect(Collectors.joining(" "))
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   500
                         + (len < availableLocales.size() ? " ..." : "");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   501
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   502
        int status = proc.waitFor();
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   503
        if (status == 0) {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   504
            System.out.println("\tDone\t" + command);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   505
        } else {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   506
            System.out.println("\tExit " + status + "\t" + command);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   507
            errors++;
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   508
        }
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   509
        System.out.println();
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   510
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   511
}