0N/A#
3261N/A# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
0N/A#
0N/A
0N/A# @test
0N/A# @bug 4958170 4891531 4989534
0N/A# @summary Test to see if default java locale settings are identical
0N/A# when launch jvm from java and javaw respectively. Test
0N/A# should be run on Windows with different user locale and
0N/A# system locale setting in ControlPanel's RegionSetting.
0N/A# Following 2 testing scenarios are recommended
0N/A# (1)systemLocale=Japanese, userLocale=English
0N/A# (2)systemLocale=English, userLocale=Japanese
0N/A# @run shell DefaultLocaleTest.sh
0N/A#
0N/A# Verify directory context variables are set
0N/Aif [ "${TESTJAVA}" = "" ]
0N/Athen
0N/A echo "TESTJAVA not set. Test cannot execute. Failed."
0N/A exit 1
0N/Afi
0N/A
0N/Aif [ "${TESTSRC}" = "" ]
0N/Athen
0N/A echo "TESTSRC not set. Test cannot execute. Failed."
0N/A exit 1
0N/Afi
0N/A
0N/AOS=`uname`
0N/A
0N/Acase "$OS" in
2078N/A Windows* )
0N/A JAVAC="${TESTJAVA}/bin/javac -d . "
0N/A JAVA="${TESTJAVA}/bin/java -classpath . "
0N/A JAVAW="${TESTJAVA}/bin/javaw -classpath . "
0N/A
0N/A ${JAVAC} ${TESTSRC}/DefaultLocaleTest.java
0N/A props=`${JAVA} DefaultLocaleTest`
0N/A ${JAVAW} DefaultLocaleTest $props
0N/A if [ $? -ne 0 ]
0N/A then
0N/A echo "Test fails"
0N/A exit 1
0N/A fi
0N/A echo "Test passes"
0N/A exit 0
0N/A ;;
2078N/A CYGWIN* )
2078N/A JAVAC="${TESTJAVA}/bin/javac -d . "
2078N/A JAVA="${TESTJAVA}/bin/java -classpath . "
2078N/A JAVAW="${TESTJAVA}/bin/javaw -classpath . "
2078N/A
2078N/A ${JAVAC} ${TESTSRC}/DefaultLocaleTest.java
2078N/A ${JAVA} DefaultLocaleTest | sed -e s@\\r@@g > x.out
2078N/A ${JAVAW} DefaultLocaleTest `cat x.out`
2078N/A if [ $? -ne 0 ]
2078N/A then
2078N/A echo "Test fails"
2078N/A exit 1
2078N/A fi
2078N/A echo "Test passes"
2078N/A exit 0
2078N/A ;;
0N/A * )
0N/A echo "Non-windows environment; test vacuously succeeds."
0N/A exit 0;
0N/A ;;
0N/Aesac
0N/A
0N/A
0N/A