author | jiangli |
Wed, 27 Sep 2017 17:55:20 -0400 | |
changeset 47548 | 664b9d44db74 |
parent 47216 | 71c04702a3d5 |
child 51328 | fad2334b2906 |
permissions | -rw-r--r-- |
796 | 1 |
/* |
7668 | 2 |
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. |
796 | 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 it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 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 |
* |
|
5506 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
796 | 22 |
*/ |
23 |
||
24 |
/* @test |
|
44115
bb4e971bf5d4
8176195: Fix misc module dependencies in jdk_core tests
xiaofeya
parents:
29121
diff
changeset
|
25 |
* @bug 4513767 4961027 6217210 |
bb4e971bf5d4
8176195: Fix misc module dependencies in jdk_core tests
xiaofeya
parents:
29121
diff
changeset
|
26 |
* @summary Checks canonical names match between old and (NIO) core charsets |
bb4e971bf5d4
8176195: Fix misc module dependencies in jdk_core tests
xiaofeya
parents:
29121
diff
changeset
|
27 |
* @modules jdk.charsets |
796 | 28 |
*/ |
29 |
import java.io.InputStreamReader; |
|
30 |
import java.io.IOException; |
|
31 |
||
32 |
public class CheckHistoricalNames { |
|
33 |
static int failed = 0; |
|
34 |
public static void main (String[] args) throws Exception { |
|
35 |
checkHistoricalName("ASCII"); |
|
36 |
checkHistoricalName("Cp1252"); |
|
37 |
checkHistoricalName("ISO8859_1"); |
|
38 |
checkHistoricalName("UnicodeBigUnmarked"); |
|
39 |
checkHistoricalName("UnicodeLittle"); |
|
40 |
checkHistoricalName("UnicodeLittleUnmarked"); |
|
41 |
checkHistoricalName("UTF8"); |
|
42 |
checkHistoricalName("UTF-16"); |
|
43 |
||
44 |
checkMappedName("UnicodeBig", "UTF-16"); |
|
45 |
checkMappedName("US-ASCII", "ASCII"); |
|
46 |
checkMappedName("ISO-8859-1", "ISO8859_1"); |
|
47 |
checkMappedName("UTF-8", "UTF8"); |
|
48 |
checkMappedName("UTF-16BE", "UnicodeBigUnmarked"); |
|
49 |
checkMappedName("UTF-16LE", "UnicodeLittleUnmarked"); |
|
50 |
||
51 |
checkHistoricalName("ISO8859_2"); |
|
52 |
checkHistoricalName("ISO8859_4"); |
|
53 |
checkHistoricalName("ISO8859_5"); |
|
54 |
checkHistoricalName("ISO8859_7"); |
|
55 |
checkHistoricalName("ISO8859_9"); |
|
56 |
checkHistoricalName("ISO8859_13"); |
|
57 |
checkHistoricalName("KOI8_R"); |
|
58 |
checkHistoricalName("Cp1250"); |
|
59 |
checkHistoricalName("Cp1251"); |
|
60 |
checkHistoricalName("Cp1253"); |
|
61 |
checkHistoricalName("Cp1254"); |
|
62 |
checkHistoricalName("Cp1257"); |
|
63 |
||
64 |
checkMappedName("ISO-8859-2", "ISO8859_2"); |
|
65 |
checkMappedName("ISO-8859-4", "ISO8859_4"); |
|
66 |
checkMappedName("ISO-8859-5", "ISO8859_5"); |
|
67 |
checkMappedName("ISO-8859-7", "ISO8859_7"); |
|
68 |
checkMappedName("ISO-8859-9", "ISO8859_9"); |
|
69 |
checkMappedName("ISO-8859-13", "ISO8859_13"); |
|
70 |
checkMappedName("KOI8-R", "KOI8_R"); |
|
71 |
checkMappedName("windows-1250", "Cp1250"); |
|
72 |
checkMappedName("windows-1251","Cp1251"); |
|
73 |
checkMappedName("windows-1253", "Cp1253"); |
|
74 |
checkMappedName("windows-1254", "Cp1254"); |
|
75 |
checkMappedName("windows-1257", "Cp1257"); |
|
76 |
||
77 |
checkHistoricalName("EUC_CN"); |
|
78 |
checkHistoricalName("EUC_JP"); |
|
79 |
checkHistoricalName("EUC_JP_LINUX"); |
|
80 |
checkHistoricalName("EUC_KR"); |
|
81 |
checkHistoricalName("EUC_TW"); |
|
82 |
checkHistoricalName("ISO2022CN"); |
|
83 |
checkHistoricalName("ISO2022JP"); |
|
84 |
checkHistoricalName("ISO2022KR"); |
|
85 |
checkHistoricalName("ISO8859_3"); |
|
86 |
checkHistoricalName("ISO8859_6"); |
|
87 |
checkHistoricalName("ISO8859_8"); |
|
88 |
checkHistoricalName("Cp1255"); |
|
89 |
checkHistoricalName("Cp1256"); |
|
90 |
checkHistoricalName("Cp1258"); |
|
91 |
checkHistoricalName("MS936"); |
|
92 |
checkHistoricalName("MS949"); |
|
93 |
checkHistoricalName("MS950"); |
|
94 |
checkHistoricalName("TIS620"); |
|
95 |
||
96 |
checkMappedName("EUC-CN", "EUC_CN"); |
|
97 |
checkMappedName("EUC-JP", "EUC_JP"); |
|
98 |
checkMappedName("EUC-JP-LINUX", "EUC_JP_LINUX"); |
|
99 |
checkMappedName("EUC-TW", "EUC_TW"); |
|
100 |
checkMappedName("EUC-KR", "EUC_KR"); |
|
101 |
checkMappedName("ISO-2022-CN", "ISO2022CN"); |
|
102 |
checkMappedName("ISO-2022-JP", "ISO2022JP"); |
|
103 |
checkMappedName("ISO-2022-KR", "ISO2022KR"); |
|
104 |
checkMappedName("ISO-8859-3", "ISO8859_3"); |
|
105 |
checkMappedName("ISO-8859-6", "ISO8859_6"); |
|
106 |
checkMappedName("ISO-8859-8", "ISO8859_8"); |
|
107 |
checkMappedName("windows-1255", "Cp1255"); |
|
108 |
checkMappedName("windows-1256", "Cp1256"); |
|
109 |
checkMappedName("windows-1258", "Cp1258"); |
|
110 |
checkMappedName("windows-936", "GBK"); |
|
111 |
checkMappedName("windows-949", "MS949"); |
|
112 |
checkMappedName("windows-950", "MS950"); |
|
113 |
checkMappedName("x-MS950-HKSCS", "MS950_HKSCS"); |
|
114 |
checkMappedName("x-PCK", "PCK"); |
|
115 |
checkMappedName("Shift_JIS", "SJIS"); |
|
116 |
checkMappedName("x-JISAutoDetect", "JISAutoDetect"); |
|
117 |
checkMappedName("TIS-620", "TIS620"); |
|
118 |
checkMappedName("x-Big5-Solaris", "Big5_Solaris"); |
|
119 |
||
120 |
checkHistoricalName("Cp037"); |
|
121 |
checkHistoricalName("Cp1006"); |
|
122 |
checkHistoricalName("Cp1025"); |
|
123 |
checkHistoricalName("Cp1026"); |
|
124 |
checkHistoricalName("Cp1046"); |
|
125 |
checkHistoricalName("Cp1047"); |
|
126 |
checkHistoricalName("Cp1097"); |
|
127 |
checkHistoricalName("Cp1098"); |
|
128 |
checkHistoricalName("Cp1112"); |
|
129 |
checkHistoricalName("Cp1122"); |
|
130 |
checkHistoricalName("Cp1123"); |
|
131 |
checkHistoricalName("Cp1124"); |
|
132 |
checkHistoricalName("Cp1140"); |
|
133 |
checkHistoricalName("Cp1141"); |
|
134 |
checkHistoricalName("Cp1142"); |
|
135 |
checkHistoricalName("Cp1143"); |
|
136 |
checkHistoricalName("Cp1144"); |
|
137 |
checkHistoricalName("Cp1145"); |
|
138 |
checkHistoricalName("Cp1146"); |
|
139 |
checkHistoricalName("Cp1147"); |
|
140 |
checkHistoricalName("Cp1148"); |
|
141 |
checkHistoricalName("Cp1149"); |
|
142 |
checkHistoricalName("Cp1381"); |
|
143 |
checkHistoricalName("Cp1383"); |
|
144 |
checkHistoricalName("Cp273"); |
|
145 |
checkHistoricalName("Cp277"); |
|
146 |
checkHistoricalName("Cp278"); |
|
147 |
checkHistoricalName("Cp280"); |
|
148 |
checkHistoricalName("Cp284"); |
|
149 |
checkHistoricalName("Cp285"); |
|
150 |
checkHistoricalName("Cp297"); |
|
151 |
checkHistoricalName("Cp33722"); |
|
152 |
checkHistoricalName("Cp420"); |
|
153 |
checkHistoricalName("Cp424"); |
|
154 |
checkHistoricalName("Cp437"); |
|
155 |
checkHistoricalName("Cp500"); |
|
156 |
checkHistoricalName("Cp737"); |
|
157 |
checkHistoricalName("Cp775"); |
|
7274 | 158 |
checkHistoricalName("Cp833"); |
796 | 159 |
checkHistoricalName("Cp838"); |
160 |
checkHistoricalName("Cp850"); |
|
161 |
checkHistoricalName("Cp852"); |
|
162 |
checkHistoricalName("Cp855"); |
|
163 |
checkHistoricalName("Cp856"); |
|
164 |
checkHistoricalName("Cp857"); |
|
165 |
checkHistoricalName("Cp858"); |
|
166 |
checkHistoricalName("Cp860"); |
|
167 |
checkHistoricalName("Cp861"); |
|
168 |
checkHistoricalName("Cp862"); |
|
169 |
checkHistoricalName("Cp863"); |
|
170 |
checkHistoricalName("Cp864"); |
|
171 |
checkHistoricalName("Cp865"); |
|
172 |
checkHistoricalName("Cp866"); |
|
173 |
checkHistoricalName("Cp868"); |
|
174 |
checkHistoricalName("Cp869"); |
|
175 |
checkHistoricalName("Cp870"); |
|
176 |
checkHistoricalName("Cp871"); |
|
177 |
checkHistoricalName("Cp874"); |
|
178 |
checkHistoricalName("Cp875"); |
|
179 |
checkHistoricalName("Cp918"); |
|
180 |
checkHistoricalName("Cp921"); |
|
181 |
checkHistoricalName("Cp922"); |
|
182 |
checkHistoricalName("Cp933"); |
|
183 |
checkHistoricalName("Cp939"); |
|
184 |
checkHistoricalName("Cp949"); |
|
185 |
checkHistoricalName("Cp964"); |
|
186 |
checkHistoricalName("Cp970"); |
|
187 |
||
188 |
checkMappedName("IBM037", "Cp037"); |
|
189 |
checkMappedName("IBM1006", "Cp1006"); |
|
190 |
checkMappedName("IBM1025", "Cp1025"); |
|
191 |
checkMappedName("IBM1026", "Cp1026"); |
|
192 |
checkMappedName("x-IBM1046", "Cp1046"); |
|
193 |
checkMappedName("IBM1047", "Cp1047"); |
|
194 |
checkMappedName("IBM1097", "Cp1097"); |
|
195 |
checkMappedName("IBM1098", "Cp1098"); |
|
196 |
checkMappedName("IBM1112", "Cp1112"); |
|
197 |
checkMappedName("IBM1122", "Cp1122"); |
|
198 |
checkMappedName("IBM1123", "Cp1123"); |
|
199 |
checkMappedName("IBM1124", "Cp1124"); |
|
29121
ab151045a89d
8071447: IBM1166 Locale Request for Kazakh characters
coffeys
parents:
7668
diff
changeset
|
200 |
checkMappedName("IBM1166", "Cp1166"); |
796 | 201 |
checkMappedName("IBM01140", "Cp1140"); |
202 |
checkMappedName("IBM01141", "Cp1141"); |
|
203 |
checkMappedName("IBM01142", "Cp1142"); |
|
204 |
checkMappedName("IBM01143", "Cp1143"); |
|
205 |
checkMappedName("IBM01144", "Cp1144"); |
|
206 |
checkMappedName("IBM01145", "Cp1145"); |
|
207 |
checkMappedName("IBM01146", "Cp1146"); |
|
208 |
checkMappedName("IBM01147", "Cp1147"); |
|
209 |
checkMappedName("IBM01148", "Cp1148"); |
|
210 |
checkMappedName("IBM01149", "Cp1149"); |
|
211 |
checkMappedName("IBM1381", "Cp1381"); |
|
212 |
checkMappedName("IBM1383", "Cp1383"); |
|
213 |
checkMappedName("IBM273", "Cp273"); |
|
214 |
checkMappedName("IBM277", "Cp277"); |
|
215 |
checkMappedName("IBM278", "Cp278"); |
|
216 |
checkMappedName("IBM280", "Cp280"); |
|
217 |
checkMappedName("IBM284", "Cp284"); |
|
218 |
checkMappedName("IBM285", "Cp285"); |
|
219 |
checkMappedName("IBM297", "Cp297"); |
|
220 |
checkMappedName("IBM33722", "Cp33722"); |
|
221 |
checkMappedName("IBM420", "Cp420"); |
|
222 |
checkMappedName("IBM424", "Cp424"); |
|
223 |
checkMappedName("IBM437", "Cp437"); |
|
224 |
checkMappedName("IBM500", "Cp500"); |
|
225 |
checkMappedName("IBM737", "Cp737"); |
|
226 |
checkMappedName("IBM775", "Cp775"); |
|
227 |
checkMappedName("IBM838", "Cp838"); |
|
228 |
checkMappedName("IBM850", "Cp850"); |
|
229 |
checkMappedName("IBM852", "Cp852"); |
|
230 |
checkMappedName("IBM855", "Cp855"); |
|
231 |
checkMappedName("IBM856", "Cp856"); |
|
232 |
checkMappedName("IBM857", "Cp857"); |
|
233 |
checkMappedName("IBM00858", "Cp858"); |
|
7274 | 234 |
checkMappedName("IBM833", "Cp833"); |
796 | 235 |
checkMappedName("IBM860", "Cp860"); |
236 |
checkMappedName("IBM861", "Cp861"); |
|
237 |
checkMappedName("IBM862", "Cp862"); |
|
238 |
checkMappedName("IBM863", "Cp863"); |
|
239 |
checkMappedName("IBM864", "Cp864"); |
|
240 |
checkMappedName("IBM865", "Cp865"); |
|
241 |
checkMappedName("IBM866", "Cp866"); |
|
242 |
checkMappedName("IBM868", "Cp868"); |
|
243 |
checkMappedName("IBM869", "Cp869"); |
|
244 |
checkMappedName("IBM870", "Cp870"); |
|
245 |
checkMappedName("IBM871", "Cp871"); |
|
246 |
checkMappedName("IBM874", "Cp874"); |
|
247 |
checkMappedName("IBM875", "Cp875"); |
|
248 |
checkMappedName("IBM918", "Cp918"); |
|
249 |
checkMappedName("IBM921", "Cp921"); |
|
250 |
checkMappedName("IBM922", "Cp922"); |
|
251 |
checkMappedName("x-IBM930", "Cp930"); |
|
252 |
checkMappedName("IBM933", "Cp933"); |
|
253 |
checkMappedName("x-IBM935", "Cp935"); |
|
254 |
checkMappedName("x-IBM937", "Cp937"); |
|
255 |
checkMappedName("IBM939", "Cp939"); |
|
256 |
checkMappedName("x-IBM942", "Cp942"); |
|
257 |
checkMappedName("x-IBM942C", "Cp942C"); |
|
258 |
checkMappedName("x-IBM943", "Cp943"); |
|
259 |
checkMappedName("x-IBM943C", "Cp943C"); |
|
260 |
checkMappedName("x-IBM948", "Cp948"); |
|
261 |
checkMappedName("IBM949", "Cp949"); |
|
262 |
checkMappedName("x-IBM949C", "Cp949C"); |
|
263 |
checkMappedName("x-IBM950", "Cp950"); |
|
264 |
checkMappedName("IBM964", "Cp964"); |
|
265 |
checkMappedName("IBM970", "Cp970"); |
|
266 |
||
267 |
checkHistoricalName("MacArabic"); |
|
268 |
checkHistoricalName("MacCentralEurope"); |
|
269 |
checkHistoricalName("MacCroatian"); |
|
270 |
checkHistoricalName("MacCyrillic"); |
|
271 |
checkHistoricalName("MacDingbat"); |
|
272 |
checkHistoricalName("MacGreek"); |
|
273 |
checkHistoricalName("MacHebrew"); |
|
274 |
checkHistoricalName("MacIceland"); |
|
275 |
checkHistoricalName("MacRoman"); |
|
276 |
checkHistoricalName("MacRomania"); |
|
277 |
checkHistoricalName("MacSymbol"); |
|
278 |
checkHistoricalName("MacThai"); |
|
279 |
checkHistoricalName("MacTurkish"); |
|
280 |
checkHistoricalName("MacUkraine"); |
|
281 |
||
282 |
checkMappedName("x-MacArabic", "MacArabic"); |
|
283 |
checkMappedName("x-MacCentralEurope", "MacCentralEurope"); |
|
284 |
checkMappedName("x-MacCroatian", "MacCroatian"); |
|
285 |
checkMappedName("x-MacCyrillic", "MacCyrillic"); |
|
286 |
checkMappedName("x-MacDingbat", "MacDingbat"); |
|
287 |
checkMappedName("x-MacGreek", "MacGreek"); |
|
288 |
checkMappedName("x-MacHebrew", "MacHebrew"); |
|
289 |
checkMappedName("x-MacIceland", "MacIceland"); |
|
290 |
checkMappedName("x-MacRoman", "MacRoman"); |
|
291 |
checkMappedName("x-MacRomania", "MacRomania"); |
|
292 |
checkMappedName("x-MacSymbol", "MacSymbol"); |
|
293 |
checkMappedName("x-MacThai", "MacThai"); |
|
294 |
checkMappedName("x-MacTurkish", "MacTurkish"); |
|
295 |
checkMappedName("x-MacUkraine", "MacUkraine"); |
|
296 |
||
297 |
if (failed != 0) |
|
298 |
throw new Exception("Test Failed: " + failed); |
|
299 |
else |
|
300 |
System.out.println("Test Passed!"); |
|
301 |
} |
|
302 |
||
303 |
private static void checkHistoricalName(String name) throws Exception { |
|
304 |
checkMappedName(name, name); |
|
305 |
} |
|
306 |
||
307 |
private static void checkMappedName(String alias, String canonical) |
|
308 |
throws Exception { |
|
309 |
InputStreamReader reader = new InputStreamReader(System.in, alias); |
|
310 |
if (!reader.getEncoding().equals(canonical)) { |
|
311 |
System.out.println("Failed canonical names : mismatch for " + alias |
|
312 |
+ " - expected " + canonical |
|
313 |
+ ", got " + reader.getEncoding()); |
|
314 |
failed++; |
|
315 |
} |
|
316 |
} |
|
317 |
} |