test/jdk/java/util/Calendar/SupplementalJapaneseEraTest.sh
changeset 50478 2e3f73b616c2
parent 47216 71c04702a3d5
equal deleted inserted replaced
50477:cb0efe0cc20e 50478:2e3f73b616c2
     1 #
     1 #
     2 # Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.
     7 # published by the Free Software Foundation.
    32 
    32 
    33 # get the start time of the fictional next era
    33 # get the start time of the fictional next era
    34 SINCE=`${TESTJAVA}/bin/java -cp "${TESTCLASSES}" SupplementalJapaneseEraTest -s`
    34 SINCE=`${TESTJAVA}/bin/java -cp "${TESTCLASSES}" SupplementalJapaneseEraTest -s`
    35 
    35 
    36 echo "Tests with valid property values..."
    36 echo "Tests with valid property values..."
    37 for P in "name=NewEra,abbr=N.E.,since=$SINCE" \
    37 for P in "name=SupEra,abbr=S.E.,since=$SINCE" \
    38          "name = NewEra, abbr = N.E., since = $SINCE"
    38          "name = SupEra, abbr = S.E., since = $SINCE"
    39 do
    39 do
    40     if ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp "${TESTCLASSES}" \
    40     if ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp "${TESTCLASSES}" \
    41            -D$PROPERTY="$P" SupplementalJapaneseEraTest -t; then
    41            -D$PROPERTY="$P" SupplementalJapaneseEraTest -t; then
    42         echo "$P: passed"
    42         echo "$P: passed"
    43     else
    43     else
    49 # get the name of the current era to be used to confirm that
    49 # get the name of the current era to be used to confirm that
    50 # invalid property values are ignored.
    50 # invalid property values are ignored.
    51 ERA=`${TESTJAVA}/bin/java -cp "${TESTCLASSES}" SupplementalJapaneseEraTest -e`
    51 ERA=`${TESTJAVA}/bin/java -cp "${TESTCLASSES}" SupplementalJapaneseEraTest -e`
    52 
    52 
    53 echo "Tests with invalid property values..."
    53 echo "Tests with invalid property values..."
    54 for P in "foo=Bar,name=NewEra,abbr=N.E.,since=$SINCE" \
    54 for P in "foo=Bar,name=SupEra,abbr=S.E.,since=$SINCE" \
    55          "=NewEra,abbr=N.E.,since=$SINCE" \
    55          "=SupEra,abbr=S.E.,since=$SINCE" \
    56          "=,abbr=N.E.,since=$SINCE" \
    56          "=,abbr=S.E.,since=$SINCE" \
    57          "name,abbr=N.E.,since=$SINCE" \
    57          "name,abbr=S.E.,since=$SINCE" \
    58          "abbr=N.E.,since=$SINCE" \
    58          "abbr=S.E.,since=$SINCE" \
    59          "name=NewEra,since=$SINCE" \
    59          "name=SupEra,since=$SINCE" \
    60          "name=,abbr=N.E.,since=$SINCE" \
    60          "name=,abbr=S.E.,since=$SINCE" \
    61          "name=NewEra,abbr=,since=$SINCE" \
    61          "name=SupEra,abbr=,since=$SINCE" \
    62          "name=NewEra,abbr=N.E." \
    62          "name=SupEra,abbr=S.E." \
    63          "name=NewEra,abbr=N.E.,since=0" \
    63          "name=SupEra,abbr=S.E.,since=0" \
    64          "name=NewEra,abbr=N.E.,since=9223372036854775808" # Long.MAX_VALUE+1
    64          "name=SupEra,abbr=S.E.,since=9223372036854775808" # Long.MAX_VALUE+1
    65 do
    65 do
    66     if ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp "${TESTCLASSES}" \
    66     if ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp "${TESTCLASSES}" \
    67            -D$PROPERTY="$P" SupplementalJapaneseEraTest -b "$ERA"; then
    67            -D$PROPERTY="$P" SupplementalJapaneseEraTest -b "$ERA"; then
    68         echo "$P: passed"
    68         echo "$P: passed"
    69     else
    69     else