test/jdk/java/util/TimeZone/OldIDMappingTest.sh
changeset 52551 339963bcff24
parent 52550 65407a437327
parent 52486 6f5948597697
child 52552 1a62b3420c27
equal deleted inserted replaced
52550:65407a437327 52551:339963bcff24
     1 # Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
       
     2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     3 #
       
     4 # This code is free software; you can redistribute it and/or modify it
       
     5 # under the terms of the GNU General Public License version 2 only, as
       
     6 # published by the Free Software Foundation.
       
     7 #
       
     8 # This code is distributed in the hope that it will be useful, but WITHOUT
       
     9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    10 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    11 # version 2 for more details (a copy is included in the LICENSE file that
       
    12 # accompanied this code).
       
    13 #
       
    14 # You should have received a copy of the GNU General Public License version
       
    15 # 2 along with this work; if not, write to the Free Software Foundation,
       
    16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    17 #
       
    18 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    19 # or visit www.oracle.com if you need additional information or have any
       
    20 # questions.
       
    21 
       
    22 # @test
       
    23 # @bug 6466476
       
    24 # @summary Compatibility test for the old JDK ID mapping and Olson IDs
       
    25 # @build OldIDMappingTest
       
    26 # @run shell OldIDMappingTest.sh
       
    27 
       
    28 : ${TESTJAVA:=${JAVA_HOME}}
       
    29 : ${TESTCLASSES:="`pwd`"}
       
    30 
       
    31 JAVA="${TESTJAVA}/bin/java"
       
    32 
       
    33 STATUS=0
       
    34 
       
    35 # Expecting the new (Olson compatible) mapping (default)
       
    36 for I in "" " " no No NO false False FALSE Hello
       
    37 do
       
    38     if [ x"$I" != x ]; then
       
    39 	D="-Dsun.timezone.ids.oldmapping=${I}"
       
    40     fi
       
    41     if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -new; then
       
    42 	STATUS=1
       
    43     fi
       
    44 done
       
    45 
       
    46 # Expecting the old mapping
       
    47 for I in true True TRUE yes Yes YES
       
    48 do
       
    49     if [ "x$I" != x ]; then
       
    50 	D="-Dsun.timezone.ids.oldmapping=${I}"
       
    51     fi
       
    52     if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -old; then
       
    53 	STATUS=1
       
    54     fi
       
    55 done
       
    56 
       
    57 exit ${STATUS}