jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java
author naoto
Tue, 04 Oct 2016 09:52:03 -0700
changeset 41229 61e0df02e2dd
parent 40813 dd5aa9c67561
child 41750 25ee1c2ee27e
permissions -rw-r--r--
8166645: Include locales plugin throws InternalError with "*" specified. Reviewed-by: mchung
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
        {
41229
61e0df02e2dd 8166645: Include locales plugin throws InternalError with "*" specified.
naoto
parents: 40813
diff changeset
    95
            "--include-locales=*",
39734
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(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   129
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   130
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   131
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
39734
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/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   134
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   135
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   136
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   137
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   138
                "(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
   139
                "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
   140
                "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
   141
                "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
   142
                "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
   143
                "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
   144
                "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
   145
                "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
   146
                "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
   147
                "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
   148
                "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
   149
                "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
   150
                "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
   151
                "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
   152
                "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
   153
                "es_UY", "es_VE"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   154
            "",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   155
        },
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   156
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   157
        // All English and Japanese locales
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   158
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   159
            "--include-locales=en,ja",
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   160
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   161
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   162
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   163
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   164
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   165
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   166
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   167
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   168
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   169
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   170
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   171
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   172
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   173
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   174
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   175
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   176
                "(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
   177
                "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
   178
                "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
   179
                "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
   180
                "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
   181
                "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
   182
                "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
   183
                "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
   184
                "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
   185
                "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
   186
                "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
   187
                "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
   188
                "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
   189
                "en_WS", "en_ZA", "en_ZM", "en_ZW", "ja", "ja_JP",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   190
                "ja_JP_JP_#u-ca-japanese"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   191
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   192
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   193
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   194
        // All locales in Austria
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   195
        {
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   196
            "--include-locales=*-AT",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   197
            "jdk.localedata",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   198
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   199
                "/jdk.localedata/sun/text/resources/ext/FormatData_de.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   200
                "/jdk.localedata/sun/text/resources/ext/FormatData_de_AT.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   201
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_de.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   202
                "/jdk.localedata/sun/text/resources/cldr/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_en_001.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   204
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_150.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   205
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_AT.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   206
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   207
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   208
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   209
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   210
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   211
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   212
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   213
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   214
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   215
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   216
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   217
                "(root)", "en", "en_US", "en_US_POSIX", "en_001", "en_150", "en_AT",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   218
                "de", "de_AT"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   219
            "",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   220
        },
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   221
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   222
        // All locales in India
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   223
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   224
            "--include-locales=*-IN",
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   225
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   226
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   227
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   228
                "/jdk.localedata/sun/text/resources/ext/FormatData_hi_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   229
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_as_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   230
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   231
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   232
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_kok_IN.class",
38747
469920616f3a 8145136: Upgrade CLDR locale data
rgoel
parents: 37790
diff changeset
   233
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_pa_Guru_IN.class"),
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   234
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   235
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   236
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   237
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   238
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   239
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   240
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   241
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   242
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   243
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   244
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   245
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   246
            List.of(
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   247
                "(root)", "as_IN", "as", "bn_IN", "bn", "bo_IN", "bo", "brx_IN", "brx",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   248
                "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
   249
                "hi", "kn_IN", "kn", "kok_IN", "kok", "ks_IN", "ks", "ml_IN", "ml",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   250
                "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
   251
                "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
   252
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   253
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   254
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   255
        // Thai
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   256
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   257
            "--include-locales=th",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   258
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   259
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   260
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   261
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   262
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   263
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   264
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   265
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   266
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   267
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   268
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   269
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   270
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   271
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   272
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   273
                "(root)", "en", "en_US", "en_US_POSIX", "th", "th_TH",
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   274
                "th_TH_TH_#u-nu-thai"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   275
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   276
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   277
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   278
        // Hong Kong
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   279
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   280
            "--include-locales=zh-HK",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   281
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   282
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   283
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   284
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_HK.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   285
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_TW.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   286
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   287
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   288
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   289
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   290
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   291
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   292
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   293
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   294
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   295
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_CN.class",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   296
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   297
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   298
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   299
            List.of(
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   300
                "(root)", "en", "en_US", "en_US_POSIX", "zh", "zh__#Hans", "zh__#Hant",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   301
                "zh_HK", "zh_HK_#Hans", "zh_HK_#Hant"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   302
            "",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   303
        },
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   304
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   305
        // Simplified Chinese
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   306
        {
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   307
            "--include-locales=zh-Hans",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   308
            "jdk.localedata",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   309
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   310
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   311
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_CN.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   312
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_SG.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   313
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   314
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   315
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   316
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   317
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   318
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   319
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   320
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   321
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   322
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   323
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   324
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   325
            List.of(
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   326
                "(root)", "en", "en_US", "en_US_POSIX", "zh", "zh__#Hans", "zh_CN",
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   327
                "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
   328
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   329
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   330
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   331
        // Norwegian
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   332
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   333
            "--include-locales=nb,nn,no",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   334
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   335
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   336
                "/jdk.localedata/sun/text/resources/ext/FormatData_no.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   337
                "/jdk.localedata/sun/text/resources/ext/FormatData_no_NO.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   338
                "/jdk.localedata/sun/text/resources/ext/FormatData_no_NO_NY.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   339
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_nb.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   340
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_nn.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   341
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   342
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   343
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   344
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   345
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   346
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   347
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   348
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   349
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   350
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   351
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   352
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   353
                "(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
   354
                "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
   355
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   356
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   357
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   358
        // Hebrew/Indonesian/Yiddish
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   359
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   360
            "--include-locales=he,id,yi",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   361
            "jdk.localedata",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   362
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   363
                "/jdk.localedata/sun/text/resources/ext/FormatData_in.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   364
                "/jdk.localedata/sun/text/resources/ext/FormatData_in_ID.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   365
                "/jdk.localedata/sun/text/resources/ext/FormatData_iw.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   366
                "/jdk.localedata/sun/text/resources/ext/FormatData_iw_IL.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   367
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_in.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   368
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_iw.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   369
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ji.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   370
            List.of(
40813
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   371
                "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   372
                "/jdk.localedata/sun/text/resources/ext/thai_dict",
dd5aa9c67561 8165605: Thai resources in jdk.localedata cause split package issue with java.base
naoto
parents: 39734
diff changeset
   373
                "/jdk.localedata/sun/text/resources/ext/WordBreakIteratorData_th",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   374
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   375
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   376
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   377
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   378
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   379
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   380
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   381
            List.of(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   382
                "(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
   383
                "ji", "ji_001"),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   384
            "",
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   385
        },
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   386
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   387
        // Error case: No matching locales
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   388
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   389
            "--include-locales=xyz",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   390
            "jdk.localedata",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   391
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   392
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   393
            null,
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   394
            new PluginException(String.format(
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   395
                PluginsResourceBundle.getMessage("include-locales.nomatchinglocales"), "xyz"))
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   396
                .getMessage(),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   397
        },
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   398
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   399
        // Error case: Invalid argument
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   400
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   401
            "--include-locales=en,zh_HK",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   402
            "jdk.localedata",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   403
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   404
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   405
            null,
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   406
            new PluginException(String.format(
39734
7701942a1e7b 8159214: jlink --include-locales problems
naoto
parents: 39051
diff changeset
   407
                PluginsResourceBundle.getMessage("include-locales.invalidtag"), "zh_hk"))
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   408
                .getMessage(),
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   409
        },
37790
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   410
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   411
        // Error case: jdk.localedata is not added
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   412
        {
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   413
            "--include-locales=en-US",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   414
            "java.base",
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   415
            null,
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   416
            null,
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   417
            null,
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   418
            new PluginException(
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   419
                PluginsResourceBundle.getMessage("include-locales.localedatanotfound"))
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   420
                .getMessage(),
71c730d5e73a 8155649: IncludeLocalesPlugin throws NPE when jdk.localedata not resolved
naoto
parents: 36739
diff changeset
   421
        },
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   422
    };
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   423
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   424
    public static void main(String[] args) throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   425
        helper = Helper.newHelper();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   426
        if (helper == null) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   427
            System.err.println("Test not run");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   428
            return;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   429
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   430
        helper.generateDefaultModules();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   431
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   432
        for (Object[] data : testData) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   433
            // create image for each test data
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   434
            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
   435
            Result result = JImageGenerator.getJLinkTask()
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   436
                    .modulePath(helper.defaultModulePath())
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   437
                    .output(helper.createNewImageDir(moduleName))
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   438
                    .addMods((String) data[ADDMODS_OPTION])
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   439
                    .option((String) data[INCLUDE_LOCALES_OPTION])
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   440
                    .call();
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   441
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   442
            String errorMsg = (String) data[ERROR_MESSAGE];
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   443
            if (errorMsg.isEmpty()) {
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   444
                Path image = result.assertSuccess();
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   445
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   446
                // test locale data entries
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   447
                testLocaleDataEntries(image,
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   448
                    (List<String>) data[EXPECTED_LOCATIONS],
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   449
                    (List<String>) data[UNEXPECTED_PATHS]);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   450
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   451
                // test available locales
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   452
                testAvailableLocales(image, (List<String>) data[AVAILABLE_LOCALES]);
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   453
            } else {
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   454
                result.assertFailure(new TaskHelper(TaskHelper.JLINK_BUNDLE)
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   455
                    .getMessage("error.prefix") + " " +errorMsg);
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   456
                System.out.println("\tExpected failure: " + result.getMessage());
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   457
            }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   458
        }
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   459
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   460
        if (errors > 0) {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   461
            throw new RuntimeException("Test failed");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   462
        }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   463
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   464
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   465
    private static void testLocaleDataEntries(Path image, List<String> expectedLocations,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   466
                        List<String> unexpectedPaths) throws Exception {
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   467
        System.out.println("testLocaleDataEntries:");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   468
        try {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   469
            JImageValidator.validate(
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   470
                image.resolve("lib").resolve("modules"),
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   471
                expectedLocations, unexpectedPaths);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   472
        } catch (Exception e) {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   473
            System.out.println("\tFailed with: " + e);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   474
            e.printStackTrace();
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   475
            errors++;
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   476
        }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   477
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   478
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   479
    private static void testAvailableLocales(Path image, List<String> availableLocales) throws Exception {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   480
        System.out.println("testAvailableLocales:");
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   481
        Path launcher = image.resolve("bin/java" +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   482
            (System.getProperty("os.name").startsWith("Windows") ? ".exe" : ""));
39051
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   483
        List<String> args = new ArrayList<>(availableLocales.size() + 2);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   484
        args.add(launcher.toString());
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   485
        args.add("GetAvailableLocales");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   486
        args.addAll(availableLocales);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   487
        Process proc = new ProcessBuilder(args).inheritIO().start();
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   488
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   489
        int len = Math.min(10, args.size());
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   490
        String command = args.subList(0, len).stream().collect(Collectors.joining(" "))
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   491
                         + (len < availableLocales.size() ? " ..." : "");
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   492
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   493
        int status = proc.waitFor();
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   494
        if (status == 0) {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   495
            System.out.println("\tDone\t" + command);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   496
        } else {
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   497
            System.out.println("\tExit " + status + "\t" + command);
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   498
            errors++;
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   499
        }
1b0204c55914 8158272: IncludeLocalesPluginTest.java fails with timeout
okutsu
parents: 38747
diff changeset
   500
        System.out.println();
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   501
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   502
}