Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/util/Locale/LocaleCategory.sh
38813 views
#!/bin/sh1#2# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#23#24# @test25# @bug 4700857 6997928 707948626# @summary tests for Locale.getDefault(Locale.Category) and27# Locale.setDefault(Locale.Category, Locale)28# @build LocaleCategory29# @run shell/timeout=600 LocaleCategory.sh3031if [ "${TESTSRC}" = "" ]32then33echo "TESTSRC not set. Test cannot execute. Failed."34exit 135fi36echo "TESTSRC=${TESTSRC}"37if [ "${TESTJAVA}" = "" ]38then39echo "TESTJAVA not set. Test cannot execute. Failed."40exit 141fi42echo "TESTJAVA=${TESTJAVA}"43if [ "${TESTCLASSES}" = "" ]44then45echo "TESTCLASSES not set. Test cannot execute. Failed."46exit 147fi48echo "TESTCLASSES=${TESTCLASSES}"49echo "CLASSPATH=${CLASSPATH}"5051# set platform-dependent variables52OS=`uname -s`53case "$OS" in54SunOS | Linux | *BSD | Darwin | AIX )55PS=":"56FS="/"57;;58Windows* | CYGWIN* )59PS=";"60FS="\\"61;;62* )63echo "Unrecognized system!"64exit 1;65;;66esac6768# test user.xxx.display user.xxx.format properties6970# run71RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"7273echo ${RUNCMD}74${RUNCMD}75result=$?7677if [ $result -eq 0 ]78then79echo "Execution successful"80else81echo "Execution of the test case failed."82fi8384# test user.xxx properties overriding user.xxx.display/format8586# run87RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Duser.language=en -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"8889echo ${RUNCMD}90${RUNCMD}91result=$?9293if [ $result -eq 0 ]94then95echo "Execution successful"96else97echo "Execution of the test case failed."98fi99100exit $result101102103