test/jdk/java/util/TimeZone/Bug8066652.sh
changeset 52551 339963bcff24
parent 52550 65407a437327
parent 52486 6f5948597697
child 52552 1a62b3420c27
equal deleted inserted replaced
52550:65407a437327 52551:339963bcff24
     1 #!/bin/sh
       
     2 
       
     3 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
       
     4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     5 #
       
     6 # This code is free software; you can redistribute it and/or modify it
       
     7 # under the terms of the GNU General Public License version 2 only, as
       
     8 # published by the Free Software Foundation.
       
     9 #
       
    10 # This code is distributed in the hope that it will be useful, but WITHOUT
       
    11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    12 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    13 # version 2 for more details (a copy is included in the LICENSE file that
       
    14 # accompanied this code).
       
    15 #
       
    16 # You should have received a copy of the GNU General Public License version
       
    17 # 2 along with this work; if not, write to the Free Software Foundation,
       
    18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    19 #
       
    20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    21 # or visit www.oracle.com if you need additional information or have any
       
    22 # questions.
       
    23 #
       
    24 # @test
       
    25 # @bug 8066652
       
    26 # @requires os.family == "mac"
       
    27 # @summary tests thread safe native function localtime_r is accessed by multiple threads at same time and
       
    28 # zone id should not be  “GMT+00:00” if default timezone is “GMT” and user specifies a fake timezone.
       
    29 # @build Bug8066652
       
    30 # @run shell/timeout=600 Bug8066652.sh
       
    31 
       
    32 
       
    33 if [ "${TESTSRC}" = "" ]
       
    34 then
       
    35   echo "TESTSRC not set.  Test cannot execute.  Failed."
       
    36   exit 1
       
    37 fi
       
    38 echo "TESTSRC=${TESTSRC}"
       
    39 if [ "${TESTJAVA}" = "" ]
       
    40 then
       
    41   echo "TESTJAVA not set.  Test cannot execute.  Failed."
       
    42   exit 1
       
    43 fi
       
    44 echo "TESTJAVA=${TESTJAVA}"
       
    45 if [ "${TESTCLASSES}" = "" ]
       
    46 then
       
    47   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
       
    48   exit 1
       
    49 fi
       
    50 echo "TESTCLASSES=${TESTCLASSES}"
       
    51 echo "CLASSPATH=${CLASSPATH}"
       
    52 
       
    53 
       
    54 # set system TimeZone to GMT using environment variable TZ
       
    55 export TZ="GMT"
       
    56 
       
    57 # Setting invalid TimeZone using VM option
       
    58 ${TESTJAVA}/bin/java -Duser.timezone=Foo/Bar  ${TESTVMOPTS} -cp ${TESTCLASSES}  Bug8066652
       
    59 
       
    60 status=$?
       
    61 if [ $status -eq 0 ]
       
    62 then
       
    63   echo "Success, Test Passed";
       
    64 else
       
    65   echo "Test Failed";
       
    66 fi
       
    67 
       
    68 exit $status