jdk/test/tools/jlink/plugins/IncludeLocalesPluginTest.java
author naoto
Tue, 29 Mar 2016 17:06:33 -0700
changeset 36739 145210aba850
parent 36666 bf6dce37a2f0
child 37790 71c730d5e73a
permissions -rw-r--r--
8152704: jlink command line output/help message improvement 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;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    25
import java.util.List;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    26
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    27
import jdk.tools.jlink.plugin.Plugin;
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    28
import jdk.tools.jlink.plugin.PluginException;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    29
import jdk.tools.jlink.internal.PluginRepository;
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    30
import jdk.tools.jlink.internal.TaskHelper;
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    31
import jdk.tools.jlink.internal.plugins.PluginsResourceBundle;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    32
import tests.Helper;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    33
import tests.JImageGenerator;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    34
import tests.JImageValidator;
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    35
import tests.Result;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    36
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    37
/*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    38
 * @test
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    39
 * @summary IncludeLocalesPlugin tests
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    40
 * @author Naoto Sato
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    41
 * @library ../../lib
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    42
 * @modules java.base/jdk.internal.jimage
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    43
 *          jdk.jdeps/com.sun.tools.classfile
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    44
 *          jdk.jlink/jdk.tools.jlink.internal
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    45
 *          jdk.jlink/jdk.tools.jlink.internal.plugins
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    46
 *          jdk.jlink/jdk.tools.jmod
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    47
 *          jdk.jlink/jdk.tools.jimage
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    48
 *          jdk.compiler
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    49
 * @build tests.*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    50
 * @build tools.jlink.plugins.GetAvailableLocales
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    51
 * @run main/othervm -verbose:gc -Xmx1g IncludeLocalesPluginTest
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    52
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    53
public class IncludeLocalesPluginTest {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    54
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    55
    private final static String moduleName = "IncludeLocalesTest";
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    56
    private static Helper helper;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    57
    private final static int INCLUDE_LOCALES_OPTION = 0;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    58
    private final static int EXPECTED_LOCATIONS     = 1;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    59
    private final static int UNEXPECTED_PATHS       = 2;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    60
    private final static int AVAILABLE_LOCALES      = 3;
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
    61
    private final static int ERROR_MESSAGE          = 4;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    62
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    63
    private final static Object[][] testData = {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    64
        // without --include-locales option: should include all locales
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    65
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    66
            "",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    67
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    68
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    69
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    70
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    71
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    72
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    73
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    74
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    75
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    76
            List.of(),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    77
            " af af_NA af_ZA agq agq_CM ak ak_GH am am_ET ar ar_001 ar_AE ar_BH " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    78
            "ar_DJ ar_DZ ar_EG ar_EH ar_ER ar_IL ar_IQ ar_JO ar_KM ar_KW ar_LB " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    79
            "ar_LY ar_MA ar_MR ar_OM ar_PS ar_QA ar_SA ar_SD ar_SO ar_SS ar_SY " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    80
            "ar_TD ar_TN ar_YE as as_IN asa asa_TZ ast ast_ES az az_AZ_#Cyrl " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    81
            "az_AZ_#Latn az__#Cyrl az__#Latn bas bas_CM be be_BY bem bem_ZM bez " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    82
            "bez_TZ bg bg_BG bm bm_ML_#Latn bm__#Latn bn bn_BD bn_IN bo bo_CN " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    83
            "bo_IN br br_FR brx brx_IN bs bs_BA_#Cyrl bs_BA_#Latn bs__#Cyrl " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    84
            "bs__#Latn ca ca_AD ca_ES ca_ES_VALENCIA ca_FR ca_IT cgg cgg_UG chr " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    85
            "chr_US cs cs_CZ cy cy_GB da da_DK da_GL dav dav_KE de de_AT de_BE " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    86
            "de_CH de_DE de_GR de_LI de_LU dje dje_NE dsb dsb_DE dua dua_CM dyo " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    87
            "dyo_SN dz dz_BT ebu ebu_KE ee ee_GH ee_TG el el_CY el_GR en en_001 " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    88
            "en_150 en_AG en_AI en_AS en_AU en_BB en_BE en_BM en_BS en_BW en_BZ " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    89
            "en_CA en_CC en_CK en_CM en_CX en_DG en_DM en_ER en_FJ en_FK en_FM " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    90
            "en_GB en_GD en_GG en_GH en_GI en_GM en_GU en_GY en_HK en_IE en_IM " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    91
            "en_IN en_IO en_JE en_JM en_KE en_KI en_KN en_KY en_LC en_LR en_LS " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    92
            "en_MG en_MH en_MO en_MP en_MS en_MT en_MU en_MW en_MY en_NA en_NF " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    93
            "en_NG en_NR en_NU en_NZ en_PG en_PH en_PK en_PN en_PR en_PW en_RW " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    94
            "en_SB en_SC en_SD en_SG en_SH en_SL en_SS en_SX en_SZ en_TC en_TK " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    95
            "en_TO en_TT en_TV en_TZ en_UG en_UM en_US en_US_POSIX en_VC en_VG " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    96
            "en_VI en_VU en_WS en_ZA en_ZM en_ZW eo eo_001 es es_419 es_AR es_BO " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    97
            "es_CL es_CO es_CR es_CU es_DO es_EA es_EC es_ES es_GQ es_GT es_HN " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    98
            "es_IC es_MX es_NI es_PA es_PE es_PH es_PR es_PY es_SV es_US es_UY " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    99
            "es_VE et et_EE eu eu_ES ewo ewo_CM fa fa_AF fa_IR ff ff_CM ff_GN " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   100
            "ff_MR ff_SN fi fi_FI fil fil_PH fo fo_FO fr fr_BE fr_BF fr_BI fr_BJ " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   101
            "fr_BL fr_CA fr_CD fr_CF fr_CG fr_CH fr_CI fr_CM fr_DJ fr_DZ fr_FR " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   102
            "fr_GA fr_GF fr_GN fr_GP fr_GQ fr_HT fr_KM fr_LU fr_MA fr_MC fr_MF " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   103
            "fr_MG fr_ML fr_MQ fr_MR fr_MU fr_NC fr_NE fr_PF fr_PM fr_RE fr_RW " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   104
            "fr_SC fr_SN fr_SY fr_TD fr_TG fr_TN fr_VU fr_WF fr_YT fur fur_IT fy " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   105
            "fy_NL ga ga_IE gd gd_GB gl gl_ES gsw gsw_CH gsw_FR gsw_LI gu gu_IN " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   106
            "guz guz_KE gv gv_IM ha ha_GH_#Latn ha_NE_#Latn ha_NG_#Latn ha__#Latn " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   107
            "haw haw_US hi hi_IN hr hr_BA hr_HR hsb hsb_DE hu hu_HU hy hy_AM ig " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   108
            "ig_NG ii ii_CN in in_ID is is_IS it it_CH it_IT it_SM iw iw_IL ja " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   109
            "ja_JP ja_JP_JP_#u-ca-japanese jgo jgo_CM ji ji_001 jmc jmc_TZ ka " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   110
            "ka_GE kab kab_DZ kam kam_KE kde kde_TZ kea kea_CV khq khq_ML ki " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   111
            "ki_KE kk kk_KZ_#Cyrl kk__#Cyrl kkj kkj_CM kl kl_GL kln kln_KE km " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   112
            "km_KH kn kn_IN ko ko_KP ko_KR kok kok_IN ks ks_IN_#Arab ks__#Arab " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   113
            "ksb ksb_TZ ksf ksf_CM ksh ksh_DE kw kw_GB ky ky_KG_#Cyrl ky__#Cyrl " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   114
            "lag lag_TZ lb lb_LU lg lg_UG lkt lkt_US ln ln_AO ln_CD ln_CF ln_CG " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   115
            "lo lo_LA lt lt_LT lu lu_CD luo luo_KE luy luy_KE lv lv_LV mas " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   116
            "mas_KE mas_TZ mer mer_KE mfe mfe_MU mg mg_MG mgh mgh_MZ mgo mgo_CM " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   117
            "mk mk_MK ml ml_IN mn mn_MN_#Cyrl mn__#Cyrl mr mr_IN ms ms_BN_#Latn " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   118
            "ms_MY ms_MY_#Latn ms_SG_#Latn ms__#Latn mt mt_MT mua mua_CM my " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   119
            "my_MM naq naq_NA nb nb_NO nb_SJ nd nd_ZW ne ne_IN ne_NP nl nl_AW " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   120
            "nl_BE nl_BQ nl_CW nl_NL nl_SR nl_SX nmg nmg_CM nn nn_NO nnh nnh_CM " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   121
            "no no_NO no_NO_NY nus nus_SD nyn nyn_UG om om_ET om_KE or or_IN os " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   122
            "os_GE os_RU pa pa_IN_#Guru pa_PK_#Arab pa__#Arab pa__#Guru pl pl_PL " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   123
            "ps ps_AF pt pt_AO pt_BR pt_CV pt_GW pt_MO pt_MZ pt_PT pt_ST pt_TL qu " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   124
            "qu_BO qu_EC qu_PE rm rm_CH rn rn_BI ro ro_MD ro_RO rof rof_TZ ru " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   125
            "ru_BY ru_KG ru_KZ ru_MD ru_RU ru_UA rw rw_RW rwk rwk_TZ sah sah_RU " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   126
            "saq saq_KE sbp sbp_TZ se se_FI se_NO se_SE seh seh_MZ ses ses_ML sg " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   127
            "sg_CF shi shi_MA_#Latn shi_MA_#Tfng shi__#Latn shi__#Tfng si si_LK " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   128
            "sk sk_SK sl sl_SI smn smn_FI sn sn_ZW so so_DJ so_ET so_KE so_SO sq " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   129
            "sq_AL sq_MK sq_XK sr sr_BA sr_BA_#Cyrl sr_BA_#Latn sr_CS sr_ME " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   130
            "sr_ME_#Cyrl sr_ME_#Latn sr_RS sr_RS_#Cyrl sr_RS_#Latn sr_XK_#Cyrl " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   131
            "sr_XK_#Latn sr__#Cyrl sr__#Latn sv sv_AX sv_FI sv_SE sw sw_CD sw_KE " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   132
            "sw_TZ sw_UG ta ta_IN ta_LK ta_MY ta_SG te te_IN teo teo_KE teo_UG " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   133
            "th th_TH th_TH_TH_#u-nu-thai ti ti_ER ti_ET to to_TO tr tr_CY tr_TR " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   134
            "twq twq_NE tzm tzm_MA_#Latn tzm__#Latn ug ug_CN_#Arab ug__#Arab uk " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   135
            "uk_UA ur ur_IN ur_PK uz uz_AF_#Arab uz_UZ_#Cyrl uz_UZ_#Latn " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   136
            "uz__#Arab uz__#Cyrl uz__#Latn vai vai_LR_#Latn vai_LR_#Vaii " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   137
            "vai__#Latn vai__#Vaii vi vi_VN vun vun_TZ wae wae_CH xog xog_UG yav " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   138
            "yav_CM yo yo_BJ yo_NG zgh zgh_MA zh zh_CN zh_CN_#Hans zh_HK " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   139
            "zh_HK_#Hans zh_HK_#Hant zh_MO_#Hans zh_MO_#Hant zh_SG zh_SG_#Hans " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   140
            "zh_TW zh_TW_#Hant zh__#Hans zh__#Hant zu zu_ZA",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   141
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   142
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   143
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   144
        // All English/Japanese locales
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   145
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   146
            "--include-locales=en,ja",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   147
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   148
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   149
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   150
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   151
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   152
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   153
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   154
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   155
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   156
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   157
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   158
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   159
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   160
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   161
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   162
            " en en_001 en_150 en_AG en_AI en_AS en_AU en_BB en_BE en_BM en_BS " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   163
            "en_BW en_BZ en_CA en_CC en_CK en_CM en_CX en_DG en_DM en_ER en_FJ " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   164
            "en_FK en_FM en_GB en_GD en_GG en_GH en_GI en_GM en_GU en_GY en_HK " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   165
            "en_IE en_IM en_IN en_IO en_JE en_JM en_KE en_KI en_KN en_KY en_LC " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   166
            "en_LR en_LS en_MG en_MH en_MO en_MP en_MS en_MT en_MU en_MW en_MY " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   167
            "en_NA en_NF en_NG en_NR en_NU en_NZ en_PG en_PH en_PK en_PN en_PR " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   168
            "en_PW en_RW en_SB en_SC en_SD en_SG en_SH en_SL en_SS en_SX en_SZ " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   169
            "en_TC en_TK en_TO en_TT en_TV en_TZ en_UG en_UM en_US en_US_POSIX " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   170
            "en_VC en_VG en_VI en_VU en_WS en_ZA en_ZM en_ZW ja ja_JP ja_JP_JP_#u-ca-japanese",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   171
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   172
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   173
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   174
        // All locales in India
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   175
        {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   176
            "--include-locales=*-IN",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   177
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   178
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   179
                "/jdk.localedata/sun/text/resources/ext/FormatData_hi_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   180
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_as_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   181
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   182
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   183
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_kok_IN.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   184
                "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_ks_Arab_IN.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   185
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   186
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   187
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   188
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   189
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   190
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   191
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   192
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   193
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   194
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   195
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   196
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   197
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   198
            " as_IN bn_IN bo_IN brx_IN en en_IN en_US en_US_POSIX gu_IN hi_IN kn_IN " +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   199
            "kok_IN ks_IN_#Arab ml_IN mr_IN ne_IN or_IN pa_IN_#Guru ta_IN te_IN ur_IN",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   200
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   201
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   202
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   203
        // Thai
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   204
        {"--include-locales=th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   205
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   206
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   207
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   208
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   209
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   210
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   211
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   212
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   213
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   214
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   215
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   216
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   217
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   218
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   219
            " en en_US en_US_POSIX th th_TH th_TH_TH_#u-nu-thai",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   220
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   221
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   222
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   223
        // Hong Kong
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   224
        {"--include-locales=zh-HK",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   225
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   226
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   227
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_HK.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   228
                "/jdk.localedata/sun/text/resources/ext/FormatData_zh_TW.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   229
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   230
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   231
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   232
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   233
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   234
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   235
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   236
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   237
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   238
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   239
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   240
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   241
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   242
            " en en_US en_US_POSIX zh_HK zh_HK_#Hans zh_HK_#Hant",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   243
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   244
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   245
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   246
        // Norwegian
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   247
        {"--include-locales=nb,nn,no",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   248
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   249
                "/jdk.localedata/sun/text/resources/ext/FormatData_no.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   250
                "/jdk.localedata/sun/text/resources/ext/FormatData_no_NO.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   251
                "/jdk.localedata/sun/text/resources/ext/FormatData_no_NO_NY.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   252
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_nb.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   253
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_nn.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   254
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   255
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   256
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   257
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   258
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   259
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   260
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   261
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   262
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   263
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   264
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   265
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   266
            " en en_US en_US_POSIX nb nb_NO nb_SJ nn 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
   267
            "",
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   268
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   269
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   270
        // Hebrew/Indonesian/Yiddish
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   271
        {"--include-locales=he,id,yi",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   272
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   273
                "/jdk.localedata/sun/text/resources/ext/FormatData_in.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   274
                "/jdk.localedata/sun/text/resources/ext/FormatData_in_ID.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   275
                "/jdk.localedata/sun/text/resources/ext/FormatData_iw.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   276
                "/jdk.localedata/sun/text/resources/ext/FormatData_iw_IL.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   277
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_in.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   278
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_iw.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   279
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ji.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   280
            List.of(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   281
                "/jdk.localedata/sun/text/resources/LineBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   282
                "/jdk.localedata/sun/text/resources/thai_dict",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   283
                "/jdk.localedata/sun/text/resources/WordBreakIteratorData_th",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   284
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorInfo_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   285
                "/jdk.localedata/sun/text/resources/ext/BreakIteratorRules_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   286
                "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   287
                "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   288
                "/jdk.localedata/sun/text/resources/ext/FormatData_th.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   289
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   290
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class",
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   291
                "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   292
            " en en_US en_US_POSIX in in_ID iw iw_IL ji ji_001",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   293
            "",
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   294
        },
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   295
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   296
        // Error case: No matching locales
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   297
        {"--include-locales=xyz",
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   298
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   299
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   300
            null,
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   301
            new PluginException(String.format(
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   302
                PluginsResourceBundle.getMessage("include-locales.nomatchinglocales"), "xyz"))
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   303
                .getMessage(),
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   304
        },
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   305
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   306
        // Error case: Invalid argument
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   307
        {"--include-locales=en,zh_HK",
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   308
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   309
            null,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   310
            null,
36739
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   311
            new PluginException(String.format(
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   312
                PluginsResourceBundle.getMessage("include-locales.invalidtag"), "zh_HK"))
145210aba850 8152704: jlink command line output/help message improvement
naoto
parents: 36666
diff changeset
   313
                .getMessage(),
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   314
        },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   315
    };
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   316
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   317
    public static void main(String[] args) throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   318
        helper = Helper.newHelper();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   319
        if (helper == null) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   320
            System.err.println("Test not run");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   321
            return;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   322
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   323
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   324
        helper.generateDefaultModules();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   325
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   326
        for (Object[] data : testData) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   327
            // create image for each test data
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   328
            Result result = JImageGenerator.getJLinkTask()
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   329
                    .modulePath(helper.defaultModulePath())
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   330
                    .output(helper.createNewImageDir(moduleName))
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   331
                    .addMods("jdk.localedata")
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   332
                    .option((String)data[INCLUDE_LOCALES_OPTION])
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   333
                    .call();
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   334
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   335
            String errorMsg = (String)data[ERROR_MESSAGE];
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   336
            if (errorMsg.isEmpty()) {
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   337
                Path image = result.assertSuccess();
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   338
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   339
                // test locale data entries
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   340
                testLocaleDataEntries(image,
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   341
                    (List<String>)data[EXPECTED_LOCATIONS],
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   342
                    (List<String>)data[UNEXPECTED_PATHS]);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   343
36666
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   344
                // test available locales
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   345
                testAvailableLocales(image, (String)data[AVAILABLE_LOCALES]);
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   346
            } else {
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   347
                result.assertFailure(new TaskHelper(TaskHelper.JLINK_BUNDLE)
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   348
                    .getMessage("error.prefix") + " " +errorMsg);
bf6dce37a2f0 8152143: jlink --include-locales should gracefully detect certain user error
naoto
parents: 36511
diff changeset
   349
            }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   350
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   351
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   352
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   353
    private static void testLocaleDataEntries(Path image, List<String> expectedLocations,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   354
                        List<String> unexpectedPaths) throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   355
        JImageValidator.validate(
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   356
            image.resolve("lib").resolve("modules"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   357
            expectedLocations, unexpectedPaths);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   358
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   359
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   360
    private static void testAvailableLocales(Path image, String availableLocales) throws Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   361
        Path launcher = image.resolve("bin/java" +
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   362
            (System.getProperty("os.name").startsWith("Windows") ? ".exe" : ""));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   363
        System.out.print(launcher);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   364
        ProcessBuilder pb = new ProcessBuilder(launcher.toString(),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   365
            "GetAvailableLocales", availableLocales);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   366
        int ret = pb.start().waitFor();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   367
        System.out.println(" Return code: " + ret);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   368
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   369
}