author | mfang |
Wed, 17 Aug 2011 14:18:26 -0700 | |
changeset 10294 | 8fcdae2a7ec7 |
parent 10116 | 21755833398f |
child 10339 | 80d9f4bc094b |
permissions | -rw-r--r-- |
6489
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
1 |
#!/bin/sh |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
2 |
# |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
3 |
# @test |
7049 | 4 |
# @bug 4700857 6997928 |
6489
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
5 |
# @summary tests for Locale.getDefault(Locale.Category) and |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
6 |
# Locale.setDefault(Locale.Category, Locale) |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
7 |
# @build LocaleCategory |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
8 |
# @run shell/timeout=600 LocaleCategory.sh |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
9 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
10 |
if [ "${TESTSRC}" = "" ] |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
11 |
then |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
12 |
echo "TESTSRC not set. Test cannot execute. Failed." |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
13 |
exit 1 |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
14 |
fi |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
15 |
echo "TESTSRC=${TESTSRC}" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
16 |
if [ "${TESTJAVA}" = "" ] |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
17 |
then |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
18 |
echo "TESTJAVA not set. Test cannot execute. Failed." |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
19 |
exit 1 |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
20 |
fi |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
21 |
echo "TESTJAVA=${TESTJAVA}" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
22 |
if [ "${TESTCLASSES}" = "" ] |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
23 |
then |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
24 |
echo "TESTCLASSES not set. Test cannot execute. Failed." |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
25 |
exit 1 |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
26 |
fi |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
27 |
echo "TESTCLASSES=${TESTCLASSES}" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
28 |
echo "CLASSPATH=${CLASSPATH}" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
29 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
30 |
# set platform-dependent variables |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
31 |
OS=`uname -s` |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
32 |
case "$OS" in |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
33 |
SunOS | Linux ) |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
34 |
PS=":" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
35 |
FS="/" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
36 |
;; |
10116
21755833398f
7012364: test/java/util/Locale/LocaleCategory.sh fails on Cygwin
peytoia
parents:
7049
diff
changeset
|
37 |
Windows* | CYGWIN* ) |
6489
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
38 |
PS=";" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
39 |
FS="\\" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
40 |
;; |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
41 |
* ) |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
42 |
echo "Unrecognized system!" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
43 |
exit 1; |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
44 |
;; |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
45 |
esac |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
46 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
47 |
# test user.xxx.display user.xxx.format properties |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
48 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
49 |
# run |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
50 |
RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Duser.language.display=ja -Duser.language.format=zh LocaleCategory" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
51 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
52 |
echo ${RUNCMD} |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
53 |
${RUNCMD} |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
54 |
result=$? |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
55 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
56 |
if [ $result -eq 0 ] |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
57 |
then |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
58 |
echo "Execution successful" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
59 |
else |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
60 |
echo "Execution of the test case failed." |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
61 |
fi |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
62 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
63 |
# test user.xxx properties overriding user.xxx.display/format |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
64 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
65 |
# run |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
66 |
RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Duser.language=en -Duser.language.display=ja -Duser.language.format=zh LocaleCategory" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
67 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
68 |
echo ${RUNCMD} |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
69 |
${RUNCMD} |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
70 |
result=$? |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
71 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
72 |
if [ $result -eq 0 ] |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
73 |
then |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
74 |
echo "Execution successful" |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
75 |
else |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
76 |
echo "Execution of the test case failed." |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
77 |
fi |
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
78 |
|
9e7015635425
4700857: RFE: separating user locale and user interface locale
naoto
parents:
diff
changeset
|
79 |
exit $result |