author | katleman |
Thu, 05 Jan 2012 08:42:37 -0800 | |
changeset 11376 | 075fe3928b7f |
parent 10148 | b951831be5f9 |
child 12047 | 320a714614e9 |
permissions | -rw-r--r-- |
4817 | 1 |
#!/bin/sh |
2 |
||
3 |
# |
|
9035
1255eb81cc2f
7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents:
5506
diff
changeset
|
4 |
# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. |
4817 | 5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6 |
# |
|
7 |
# This code is free software; you can redistribute it and/or modify it |
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
|
9 |
# published by the Free Software Foundation. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
4817 | 24 |
# |
25 |
||
26 |
# @test |
|
27 |
# @summary Verify that sun.nio.cs.map property interpreted in ja multibyte locales |
|
28 |
# @bug 4879123 |
|
29 |
# @build SJISPropTest |
|
30 |
# |
|
31 |
# @run shell/timeout=300 CheckSJISMappingProp.sh |
|
32 |
||
33 |
# set platform-dependent variables |
|
34 |
||
35 |
OS=`uname -s` |
|
36 |
case "$OS" in |
|
37 |
SunOS | Linux ) ;; |
|
38 |
# Skip locale test for Windows |
|
10148
b951831be5f9
7036518: TEST_BUG: add cygwin support to test/java/nio/charset/coders/CheckSJISMappingProp.sh
mchung
parents:
9035
diff
changeset
|
39 |
Windows* | CYGWIN* ) |
4817 | 40 |
echo "Passed"; exit 0 ;; |
41 |
* ) echo "Unrecognized system!" ; exit 1 ;; |
|
42 |
esac |
|
43 |
||
44 |
expectPass() { |
|
45 |
if [ $1 -eq 0 ] |
|
46 |
then echo "--- passed as expected" |
|
47 |
else |
|
48 |
echo "--- failed" |
|
49 |
exit $1 |
|
50 |
fi |
|
51 |
} |
|
52 |
||
53 |
||
54 |
JAVA="${TESTJAVA}/bin/java -cp ${TESTCLASSES}" |
|
55 |
runTest() { |
|
56 |
echo "Testing:" ${1} |
|
57 |
LC_ALL="$1" ; export LC_ALL |
|
58 |
locale |
|
59 |
# Firstly, test with property set |
|
60 |
# (shift_jis should map to windows-31J charset) |
|
61 |
${JAVA} -Dsun.nio.cs.map="Windows-31J/Shift_JIS" SJISPropTest MS932 |
|
62 |
expectPass $? |
|
63 |
||
64 |
# Next, test without property set - "shift_jis" follows IANA conventions |
|
65 |
# and should map to the sun.nio.cs.ext.Shift_JIS charset |
|
66 |
${JAVA} SJISPropTest Shift_JIS |
|
67 |
expectPass $? |
|
68 |
} |
|
69 |
||
70 |
# Run the test in the common Solaris/Linux locales |
|
71 |
# Tests will simply run in current locale if locale isn't supported |
|
72 |
# on the test machine/platform |
|
73 |
||
74 |
for i in "ja" "ja_JP.PCK" "ja_JP.eucJP" ; do |
|
75 |
runTest ${i} |
|
76 |
done |