jdk/test/java/util/Locale/LocaleProviders.sh
author alanb
Fri, 11 Jan 2013 20:19:55 +0000
changeset 15254 3997a6f357cb
parent 14786 a9f61e0cbe61
child 17169 5e5039c3181d
permissions -rw-r--r--
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools Reviewed-by: chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     1
#
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     2
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     4
#
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     7
# published by the Free Software Foundation.
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     8
#
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    13
# accompanied this code).
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    14
#
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    18
#
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    21
# questions.
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    22
#
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    23
#!/bin/sh
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    24
#
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    25
# @test
14336
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
    26
# @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    27
# @summary tests for "java.locale.providers" system property
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    28
# @compile -XDignore.symbol.file LocaleProviders.java
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    29
# @run shell/timeout=600 LocaleProviders.sh
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    30
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    31
if [ "${TESTSRC}" = "" ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    32
then
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    33
  echo "TESTSRC not set.  Test cannot execute.  Failed."
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    34
  exit 1
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    35
fi
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    36
echo "TESTSRC=${TESTSRC}"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    37
if [ "${TESTJAVA}" = "" ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    38
then
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    39
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    40
  exit 1
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    41
fi
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    42
if [ "${COMPILEJAVA}" = "" ]
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    43
then
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    44
  COMPILEJAVA="${TESTJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    45
fi
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    46
echo "TESTJAVA=${TESTJAVA}"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    47
if [ "${TESTCLASSES}" = "" ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    48
then
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    49
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    50
  exit 1
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    51
fi
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    52
echo "TESTCLASSES=${TESTCLASSES}"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    53
echo "CLASSPATH=${CLASSPATH}"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    54
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    55
# set platform-dependent variables
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    56
OS=`uname -s`
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    57
case "$OS" in
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    58
  SunOS | Linux | *BSD | Darwin )
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    59
    PS=":"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    60
    FS="/"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    61
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    62
  Windows* | CYGWIN* )
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    63
    PS=";"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    64
    FS="\\"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    65
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    66
  * )
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    67
    echo "Unrecognized system!"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    68
    exit 1;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    69
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    70
esac
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    71
14185
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    72
# create an SPI implementation
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    73
mk() {
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    74
  d=`dirname $1`
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    75
  if [ ! -d $d ]; then mkdir -p $d; fi
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    76
  cat - >$1
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    77
}
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    78
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    79
SPIDIR=${TESTCLASSES}${FS}spi
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    80
rm -rf ${SPIDIR}
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    81
mk ${SPIDIR}${FS}src${FS}tznp.java << EOF
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    82
import java.util.spi.TimeZoneNameProvider;
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    83
import java.util.Locale;
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    84
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    85
public class tznp extends TimeZoneNameProvider {
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    86
    public String getDisplayName(String ID, boolean daylight, int style, Locale locale) {
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    87
        return "tznp";
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    88
    }
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    89
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    90
    public Locale[] getAvailableLocales() {
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    91
        Locale[] locales = {Locale.GERMAN, Locale.US, Locale.JAPANESE, Locale.CHINESE};
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    92
        return locales;
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    93
    }
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    94
}
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    95
EOF
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    96
mk ${SPIDIR}${FS}dest${FS}META-INF${FS}services${FS}java.util.spi.TimeZoneNameProvider << EOF
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    97
tznp
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    98
EOF
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    99
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${SPIDIR}${FS}dest \
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
   100
    ${SPIDIR}${FS}src${FS}tznp.java
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
   101
${COMPILEJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
14185
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   102
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   103
# get the platform default locales
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14336
diff changeset
   104
PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   105
DEFLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   106
DEFCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   107
echo "DEFLANG=${DEFLANG}"
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   108
echo "DEFCTRY=${DEFCTRY}"
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14336
diff changeset
   109
PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale format`
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   110
DEFFMTLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   111
DEFFMTCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   112
echo "DEFFMTLANG=${DEFFMTLANG}"
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   113
echo "DEFFMTCTRY=${DEFFMTCTRY}"
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   114
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   115
runTest()
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   116
{
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14336
diff changeset
   117
    RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Djava.locale.providers=$PREFLIST LocaleProviders $METHODNAME $PARAM1 $PARAM2 $PARAM3"
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   118
    echo ${RUNCMD}
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   119
    ${RUNCMD}
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   120
    result=$?
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   121
    if [ $result -eq 0 ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   122
    then
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   123
      echo "Execution successful"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   124
    else
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   125
      echo "Execution of the test case failed."
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   126
      exit $result
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   127
    fi
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   128
}
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   129
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   130
# testing HOST is selected for the default locale, if specified on Windows or MacOSX
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   131
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   132
PREFLIST=HOST,JRE
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   133
case "$OS" in
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   134
  Windows_NT* )
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   135
    WINVER=`uname -r`
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   136
    if [ "${WINVER}" = "5" ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   137
    then
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   138
      PARAM1=JRE
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   139
    else
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   140
      PARAM1=HOST
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   141
    fi
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   142
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   143
  CYGWIN_NT-6* | Darwin )
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   144
    PARAM1=HOST
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   145
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   146
  * )
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   147
    PARAM1=JRE
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   148
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   149
esac
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   150
PARAM2=${DEFLANG}
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   151
PARAM3=${DEFCTRY}
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   152
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   153
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   154
# testing HOST is NOT selected for the non-default locale, if specified
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   155
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   156
PREFLIST=HOST,JRE
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   157
PARAM1=JRE
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   158
# Try to find the locale JRE supports which is not the platform default (HOST supports that one)
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   159
if [ "${DEFLANG}" != "en" ] && [ "${DEFFMTLANG}" != "en" ]; then
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   160
  PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   161
  PARAM3=US
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   162
elif [ "${DEFLANG}" != "ja" ] && [ "${DEFFMTLANG}" != "ja" ]; then 
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   163
  PARAM2=ja
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   164
  PARAM3=JP
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   165
else
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   166
  PARAM2=zh
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   167
  PARAM3=CN
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   168
fi
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   169
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   170
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   171
# testing SPI is NOT selected, as there is none.
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   172
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   173
PREFLIST=SPI,JRE
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   174
PARAM1=JRE
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   175
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   176
PARAM3=US
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   177
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   178
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   179
# testing the order, variaton #1. This assumes en_GB DateFormat data are available both in JRE & CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   180
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   181
PREFLIST=CLDR,JRE
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   182
PARAM1=CLDR
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   183
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   184
PARAM3=GB
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   185
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   186
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   187
# testing the order, variaton #2. This assumes en_GB DateFormat data are available both in JRE & CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   188
METHODNAME=adapterTest
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   189
PREFLIST=JRE,CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   190
PARAM1=JRE
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   191
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   192
PARAM3=GB
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   193
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   194
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   195
# testing the order, variaton #3 for non-existent locale in JRE assuming "haw" is not in JRE.
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   196
METHODNAME=adapterTest
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   197
PREFLIST=JRE,CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   198
PARAM1=CLDR
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   199
PARAM2=haw
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   200
PARAM3=GB
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   201
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   202
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   203
# testing the order, variaton #4 for the bug 7196799. CLDR's "zh" data should be used in "zh_CN"
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   204
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   205
PREFLIST=CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   206
PARAM1=CLDR
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   207
PARAM2=zh
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   208
PARAM3=CN
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   209
runTest
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   210
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   211
# testing FALLBACK provider. SPI and invalid one cases.
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   212
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   213
PREFLIST=SPI
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   214
PARAM1=FALLBACK
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   215
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   216
PARAM3=US
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   217
runTest
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   218
PREFLIST=FOO
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   219
PARAM1=JRE
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   220
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   221
PARAM3=US
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   222
runTest
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   223
PREFLIST=BAR,SPI
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   224
PARAM1=FALLBACK
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   225
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   226
PARAM3=US
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   227
runTest
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   228
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   229
# testing 7198834 fix. Only works on Windows Vista or upper.
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   230
METHODNAME=bug7198834Test
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   231
PREFLIST=HOST
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   232
PARAM1=
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   233
PARAM2=
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   234
PARAM3=
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   235
runTest
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   236
14185
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   237
# testing 8000245 fix.
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   238
METHODNAME=tzNameTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   239
PREFLIST="JRE -Djava.ext.dirs=${SPIDIR}"
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   240
PARAM1=Europe/Moscow
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   241
PARAM2=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   242
PARAM3=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   243
runTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   244
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   245
# testing 8000615 fix.
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   246
METHODNAME=tzNameTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   247
PREFLIST="JRE -Djava.ext.dirs=${SPIDIR}"
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   248
PARAM1=America/Los_Angeles
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   249
PARAM2=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   250
PARAM3=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   251
runTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   252
14336
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   253
# testing 8001440 fix.
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   254
METHODNAME=bug8001440Test
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   255
PREFLIST=CLDR
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   256
PARAM1=
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   257
PARAM2=
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   258
PARAM3=
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   259
runTest
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   260
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   261
exit $result