jdk/test/java/util/TimeZone/OldIDMappingTest.sh
author xdono
Mon, 15 Dec 2008 16:55:25 -0800
changeset 1639 a97859015238
parent 1315 ad5950a1098c
child 5506 202f599c92aa
permissions -rw-r--r--
6785258: Update copyright year Summary: Update copyright for files that have been modified starting July 2008 to Dec 2008 Reviewed-by: katleman, ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1639
a97859015238 6785258: Update copyright year
xdono
parents: 1315
diff changeset
     1
# Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
1315
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     2
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     3
#
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     4
# This code is free software; you can redistribute it and/or modify it
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     5
# under the terms of the GNU General Public License version 2 only, as
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     6
# published by the Free Software Foundation.  Sun designates this
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     7
# particular file as subject to the "Classpath" exception as provided
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     8
# by Sun in the LICENSE file that accompanied this code.
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
     9
#
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    14
# accompanied this code).
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    15
#
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    19
#
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    20
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    21
# CA 95054 USA or visit www.sun.com if you need additional information or
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    22
# have any questions.
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    23
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    24
# @test
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    25
# @bug 6466476
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    26
# @summary Compatibility test for the old JDK ID mapping and Olson IDs
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    27
# @build OldIDMappingTest
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    28
# @run shell OldIDMappingTest.sh
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    29
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    30
: ${TESTJAVA:=${JAVA_HOME}}
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    31
: ${TESTCLASSES:="`pwd`"}
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    32
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    33
JAVA="${TESTJAVA}/bin/java"
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    34
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    35
STATUS=0
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    36
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    37
# Expecting the new (Olson compatible) mapping (default)
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    38
for I in "" " " no No NO false False FALSE Hello
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    39
do
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    40
    if [ x"$I" != x ]; then
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    41
	D="-Dsun.timezone.ids.oldmapping=${I}"
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    42
    fi
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    43
    if ! ${JAVA} ${D} -cp ${TESTCLASSES} OldIDMappingTest -new; then
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    44
	STATUS=1
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    45
    fi
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    46
done
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    47
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    48
# Expecting the old mapping
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    49
for I in true True TRUE yes Yes YES
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    50
do
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    51
    if [ "x$I" != x ]; then
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    52
	D="-Dsun.timezone.ids.oldmapping=${I}"
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    53
    fi
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    54
    if ! ${JAVA} ${D} -cp ${TESTCLASSES} OldIDMappingTest -old; then
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    55
	STATUS=1
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    56
    fi
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    57
done
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    58
ad5950a1098c 6466476: (tz) Introduction of tzdata2005r can introduce incompatility issues with some JDK1.1 3-letter TZ Ids
peytoia
parents:
diff changeset
    59
exit ${STATUS}