jdk/test/java/util/Locale/LocaleProviders.sh
author chegar
Thu, 13 Dec 2012 14:47:35 +0000
changeset 14786 a9f61e0cbe61
parent 14336 4a3418a2c07f
child 15254 3997a6f357cb
permissions -rw-r--r--
8003890: corelibs test scripts should pass TESTVMOPTS Reviewed-by: chegar, alanb Contributed-by: Mark Sheppard <mark.sheppard@oracle.com>
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
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    42
echo "TESTJAVA=${TESTJAVA}"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    43
if [ "${TESTCLASSES}" = "" ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    44
then
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    45
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    46
  exit 1
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    47
fi
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    48
echo "TESTCLASSES=${TESTCLASSES}"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    49
echo "CLASSPATH=${CLASSPATH}"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    50
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    51
# set platform-dependent variables
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    52
OS=`uname -s`
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    53
case "$OS" in
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    54
  SunOS | Linux | *BSD | Darwin )
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    55
    PS=":"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    56
    FS="/"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    57
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    58
  Windows* | CYGWIN* )
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
  * )
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    63
    echo "Unrecognized system!"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    64
    exit 1;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    65
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    66
esac
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
    67
14185
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    68
# create an SPI implementation
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    69
mk() {
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    70
  d=`dirname $1`
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    71
  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
    72
  cat - >$1
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    73
}
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    74
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    75
SPIDIR=${TESTCLASSES}${FS}spi
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    76
rm -rf ${SPIDIR}
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    77
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
    78
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
    79
import java.util.Locale;
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    80
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    81
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
    82
    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
    83
        return "tznp";
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
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    86
    public Locale[] getAvailableLocales() {
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    87
        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
    88
        return locales;
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
}
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    91
EOF
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    92
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
    93
tznp
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    94
EOF
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    95
${TESTJAVA}${FS}bin${FS}javac -d ${SPIDIR}${FS}dest ${SPIDIR}${FS}src${FS}tznp.java
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    96
${TESTJAVA}${FS}bin${FS}jar cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
    97
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
    98
# get the platform default locales
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14336
diff changeset
    99
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
   100
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
   101
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
   102
echo "DEFLANG=${DEFLANG}"
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   103
echo "DEFCTRY=${DEFCTRY}"
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 format`
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   105
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
   106
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
   107
echo "DEFFMTLANG=${DEFFMTLANG}"
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   108
echo "DEFFMTCTRY=${DEFFMTCTRY}"
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   109
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   110
runTest()
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   111
{
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14336
diff changeset
   112
    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
   113
    echo ${RUNCMD}
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   114
    ${RUNCMD}
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   115
    result=$?
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   116
    if [ $result -eq 0 ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   117
    then
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   118
      echo "Execution successful"
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   119
    else
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   120
      echo "Execution of the test case failed."
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   121
      exit $result
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   122
    fi
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   123
}
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   124
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   125
# 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
   126
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   127
PREFLIST=HOST,JRE
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   128
case "$OS" in
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   129
  Windows_NT* )
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   130
    WINVER=`uname -r`
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   131
    if [ "${WINVER}" = "5" ]
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   132
    then
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   133
      PARAM1=JRE
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   134
    else
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   135
      PARAM1=HOST
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   136
    fi
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   137
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   138
  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
   139
    PARAM1=HOST
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   140
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   141
  * )
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   142
    PARAM1=JRE
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   143
    ;;
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   144
esac
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   145
PARAM2=${DEFLANG}
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   146
PARAM3=${DEFCTRY}
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   147
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   148
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   149
# 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
   150
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   151
PREFLIST=HOST,JRE
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   152
PARAM1=JRE
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   153
# 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
   154
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
   155
  PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   156
  PARAM3=US
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   157
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
   158
  PARAM2=ja
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   159
  PARAM3=JP
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   160
else
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   161
  PARAM2=zh
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   162
  PARAM3=CN
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   163
fi
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   164
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   165
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   166
# 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
   167
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   168
PREFLIST=SPI,JRE
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   169
PARAM1=JRE
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   170
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   171
PARAM3=US
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   172
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   173
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   174
# 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
   175
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   176
PREFLIST=CLDR,JRE
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   177
PARAM1=CLDR
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   178
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   179
PARAM3=GB
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   180
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   181
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   182
# 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
   183
METHODNAME=adapterTest
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   184
PREFLIST=JRE,CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   185
PARAM1=JRE
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   186
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   187
PARAM3=GB
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   188
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   189
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   190
# 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
   191
METHODNAME=adapterTest
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   192
PREFLIST=JRE,CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   193
PARAM1=CLDR
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   194
PARAM2=haw
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   195
PARAM3=GB
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   196
runTest
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   197
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   198
# 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
   199
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   200
PREFLIST=CLDR
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   201
PARAM1=CLDR
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   202
PARAM2=zh
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   203
PARAM3=CN
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   204
runTest
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   205
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   206
# 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
   207
METHODNAME=adapterTest
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   208
PREFLIST=SPI
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   209
PARAM1=FALLBACK
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   210
PARAM2=en
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   211
PARAM3=US
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   212
runTest
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   213
PREFLIST=FOO
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   214
PARAM1=JRE
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=BAR,SPI
14028
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   219
PARAM1=FALLBACK
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
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   222
runTest
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   223
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   224
# 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
   225
METHODNAME=bug7198834Test
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   226
PREFLIST=HOST
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   227
PARAM1=
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   228
PARAM2=
5f3d5ae5f1ea 7198834: HOST Adapter: one extra empty space in the end of the pattern string
naoto
parents: 14024
diff changeset
   229
PARAM3=
14024
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   230
runTest
694c379c2958 7196799: CLDR adapter can not be invoked when region code is specified in Locale
naoto
parents: 13583
diff changeset
   231
14185
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   232
# testing 8000245 fix.
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   233
METHODNAME=tzNameTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   234
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
   235
PARAM1=Europe/Moscow
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   236
PARAM2=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   237
PARAM3=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   238
runTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   239
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   240
# testing 8000615 fix.
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   241
METHODNAME=tzNameTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   242
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
   243
PARAM1=America/Los_Angeles
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   244
PARAM2=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   245
PARAM3=
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   246
runTest
916ec0a4d039 8000245: SimpleDateFormat.format(date, StringBuffer, FieldPosition) doesn't work as expected with custom extensions
naoto
parents: 14028
diff changeset
   247
14336
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   248
# testing 8001440 fix.
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   249
METHODNAME=bug8001440Test
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   250
PREFLIST=CLDR
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   251
PARAM1=
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   252
PARAM2=
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   253
PARAM3=
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   254
runTest
4a3418a2c07f 8001440: CLDR adapter: Invalid number extension in language tag causes exception in NumberFormat.format()
naoto
parents: 14185
diff changeset
   255
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents:
diff changeset
   256
exit $result