34
35 OS=`uname -s`
36 case "$OS" in
37 SunOS | Linux | Darwin | AIX ) ;;
38 # Skip locale test for Windows
39 Windows* )
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
|
34
35 OS=`uname -s`
36 case "$OS" in
37 SunOS | Linux | Darwin | AIX ) ;;
38 # Skip locale test for Windows
39 Windows* )
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 ${TESTVMOPTS} -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
|