1 // Tags: JDK1.0 |
|
2 |
|
3 // Copyright (C) 2004, 2005 Michael Koch <konqueror@gmx.de> |
|
4 |
|
5 // This file is part of Mauve. |
|
6 |
|
7 // Mauve is free software; you can redistribute it and/or modify |
|
8 // it under the terms of the GNU General Public License as published by |
|
9 // the Free Software Foundation; either version 2, or (at your option) |
|
10 // any later version. |
|
11 |
|
12 // Mauve is distributed in the hope that it will be useful, |
|
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 // GNU General Public License for more details. |
|
16 |
|
17 // You should have received a copy of the GNU General Public License |
|
18 // along with Mauve; see the file COPYING. If not, write to |
|
19 // the Free Software Foundation, 59 Temple Place - Suite 330, |
|
20 // Boston, MA 02111-1307, USA. */ |
|
21 |
|
22 package gnu.testlet.locales; |
|
23 |
|
24 import gnu.testlet.Testlet; |
|
25 import gnu.testlet.TestHarness; |
|
26 |
|
27 import java.text.*; |
|
28 import java.util.*; |
|
29 |
|
30 public class LocaleTest |
|
31 implements Testlet |
|
32 { |
|
33 public class ExpectedValues |
|
34 { |
|
35 String language; |
|
36 String country; |
|
37 String variant; |
|
38 String localeStr; |
|
39 String iso3language; |
|
40 String iso3country; |
|
41 String displayLanguage; |
|
42 String displayCountry; |
|
43 String displayVariant; |
|
44 String displayName; |
|
45 String currencyCode; |
|
46 int currencyFractionDigits; |
|
47 String currencySymbol; |
|
48 |
|
49 public ExpectedValues(String language, String country, String variant, String localeStr, |
|
50 String iso3language, String iso3country, |
|
51 String displayLanguage, String displayCountry, |
|
52 String displayVariant, String displayName, |
|
53 String currencyCode, int currencyFractionDigits, |
|
54 String currencySymbol) |
|
55 { |
|
56 this.language = language; |
|
57 this.country = country; |
|
58 this.variant = variant; |
|
59 this.localeStr = localeStr; |
|
60 this.iso3language = iso3language; |
|
61 this.iso3country = iso3country; |
|
62 this.displayLanguage = displayLanguage; |
|
63 this.displayCountry = displayCountry; |
|
64 this.displayVariant = displayVariant; |
|
65 this.displayName = displayName; |
|
66 this.currencyCode = currencyCode; |
|
67 this.currencyFractionDigits = currencyFractionDigits; |
|
68 this.currencySymbol = currencySymbol; |
|
69 } |
|
70 } |
|
71 |
|
72 public class ExpectedDateValues |
|
73 { |
|
74 String a, b, c, d, e, f, g, h; |
|
75 |
|
76 public ExpectedDateValues(String a, String b, String c, String d, String e, String f, String g, String h) |
|
77 { |
|
78 this.a = a; |
|
79 this.b = b; |
|
80 this.c = c; |
|
81 this.d = d; |
|
82 this.e = e; |
|
83 this.f = f; |
|
84 this.g = g; |
|
85 this.h = h; |
|
86 } |
|
87 } |
|
88 |
|
89 public class ExpectedNumberValues |
|
90 { |
|
91 String a, b, c, d, e; |
|
92 |
|
93 public ExpectedNumberValues(String a, String b, String c, String d, String e) |
|
94 { |
|
95 this.a = a; |
|
96 this.b = b; |
|
97 this.c = c; |
|
98 this.d = d; |
|
99 this.e = e; |
|
100 } |
|
101 } |
|
102 |
|
103 private void checkLocale(TestHarness h, Locale locale, |
|
104 ExpectedValues expected, |
|
105 ExpectedDateValues expectedDate, |
|
106 ExpectedNumberValues expectedNumber1, |
|
107 ExpectedNumberValues expectedNumberCurrency1, |
|
108 ExpectedNumberValues expectedNumberCurrency2, |
|
109 ExpectedNumberValues expectedNumber3, |
|
110 ExpectedNumberValues expectedNumber4, |
|
111 ExpectedNumberValues expectedNumberProcent) |
|
112 { |
|
113 h.checkPoint("Locale " + locale); |
|
114 |
|
115 // Force GERMAN as default locale. |
|
116 Locale.setDefault(Locale.GERMAN); |
|
117 TimeZone.setDefault(TimeZone.getTimeZone("GMT")); |
|
118 |
|
119 // Locale |
|
120 |
|
121 if (expected != null) |
|
122 { |
|
123 h.check(locale.getLanguage(), expected.language); |
|
124 h.check(locale.getCountry(), expected.country); |
|
125 h.check(locale.getVariant(), expected.variant); |
|
126 h.check(locale.toString(), expected.localeStr); |
|
127 h.check(locale.getISO3Language(), expected.iso3language); |
|
128 h.check(locale.getISO3Country(), expected.iso3country); |
|
129 h.check(locale.getDisplayLanguage(), expected.displayLanguage); |
|
130 h.check(locale.getDisplayCountry(), expected.displayCountry); |
|
131 h.check(locale.getDisplayVariant(), expected.displayVariant); |
|
132 h.check(locale.getDisplayName(), expected.displayName); |
|
133 } |
|
134 |
|
135 // Date and time formats |
|
136 h.debug("Locale " + locale + " date/time formats"); |
|
137 |
|
138 if (expectedDate != null) |
|
139 { |
|
140 DateFormat df; |
|
141 |
|
142 Date date1 = new Date(74, 2, 18, 17, 20, 30); |
|
143 |
|
144 // Date instance. |
|
145 |
|
146 df = DateFormat.getDateInstance(DateFormat.DEFAULT, locale); |
|
147 h.check(df.format(date1), expectedDate.a, "DateFormat.DEFAULT "+ locale); |
|
148 |
|
149 df = DateFormat.getDateInstance(DateFormat.SHORT, locale); |
|
150 h.check(df.format(date1), expectedDate.b, "DateFormat.SHORT "+ locale); |
|
151 |
|
152 df = DateFormat.getDateInstance(DateFormat.MEDIUM, locale); |
|
153 h.check(df.format(date1), expectedDate.c, "DateFormat.MEDIUM "+ locale); |
|
154 |
|
155 df = DateFormat.getDateInstance(DateFormat.LONG, locale); |
|
156 h.check(df.format(date1), expectedDate.d, "DateFormat.LONG "+ locale); |
|
157 |
|
158 // Assume DEFAULT == MEDIUM |
|
159 df = DateFormat.getDateInstance(DateFormat.DEFAULT, locale); |
|
160 h.check(df.format(date1), expectedDate.c, "DateFormat.DEFAULT == DateFormat.MEDIUM "+ locale); |
|
161 |
|
162 // Time instance. |
|
163 |
|
164 df = DateFormat.getTimeInstance(DateFormat.DEFAULT, locale); |
|
165 h.check(df.format(date1), expectedDate.e, "DateFormat.DEFAULT "+ locale); |
|
166 |
|
167 df = DateFormat.getTimeInstance(DateFormat.SHORT, locale); |
|
168 h.check(df.format(date1), expectedDate.f, "DateFormat.SHORT "+ locale); |
|
169 |
|
170 df = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale); |
|
171 h.check(df.format(date1), expectedDate.g, "DateFormat.MEDIUM "+ locale); |
|
172 |
|
173 df = DateFormat.getTimeInstance(DateFormat.LONG, locale); |
|
174 h.check(df.format(date1), expectedDate.h, "DateFormat.LONG "+ locale); |
|
175 |
|
176 // Assume DEFAULT == MEDIUM |
|
177 df = DateFormat.getTimeInstance(DateFormat.DEFAULT, locale); |
|
178 h.check(df.format(date1), expectedDate.g, "DateFormat.DEFAULT == DateFormat.MEDIUM "+ locale); |
|
179 } |
|
180 |
|
181 h.checkPoint("numberformats locale: "+ locale); |
|
182 // Number formats |
|
183 |
|
184 NumberFormat nf; |
|
185 |
|
186 if (expectedNumber1 != null) |
|
187 { |
|
188 nf = NumberFormat.getInstance(locale); |
|
189 |
|
190 h.check(nf.format(1000L), expectedNumber1.a); |
|
191 h.check(nf.format(1000000L), expectedNumber1.b); |
|
192 h.check(nf.format(100d), expectedNumber1.c); |
|
193 h.check(nf.format(100.1234d), expectedNumber1.d); |
|
194 h.check(nf.format(10000000.1234d), expectedNumber1.e); |
|
195 } |
|
196 |
|
197 if (expectedNumberCurrency1 != null) |
|
198 { |
|
199 nf = NumberFormat.getCurrencyInstance(locale); |
|
200 |
|
201 h.check(nf.format(1000L), expectedNumberCurrency1.a); |
|
202 h.check(nf.format(1000000L), expectedNumberCurrency1.b); |
|
203 h.check(nf.format(100d), expectedNumberCurrency1.c); |
|
204 h.check(nf.format(100.1234d), expectedNumberCurrency1.d); |
|
205 h.check(nf.format(10000000.1234d), expectedNumberCurrency1.e); |
|
206 } |
|
207 |
|
208 if (expectedNumberCurrency2 != null) |
|
209 { |
|
210 nf = NumberFormat.getCurrencyInstance(locale); |
|
211 |
|
212 h.check(nf.format(-1000L), expectedNumberCurrency2.a); |
|
213 h.check(nf.format(-1000000L), expectedNumberCurrency2.b); |
|
214 h.check(nf.format(-100d), expectedNumberCurrency2.c); |
|
215 h.check(nf.format(-100.1234d), expectedNumberCurrency2.d); |
|
216 h.check(nf.format(-10000000.1234d), expectedNumberCurrency2.e); |
|
217 } |
|
218 |
|
219 if (expectedNumber3 != null) |
|
220 { |
|
221 nf = NumberFormat.getIntegerInstance(locale); |
|
222 |
|
223 h.check(nf.format(1000L), expectedNumber3.a); |
|
224 h.check(nf.format(1000000L), expectedNumber3.b); |
|
225 h.check(nf.format(100d), expectedNumber3.c); |
|
226 h.check(nf.format(100.1234d), expectedNumber3.d); |
|
227 h.check(nf.format(10000000.1234d), expectedNumber3.e); |
|
228 } |
|
229 |
|
230 if (expectedNumber4 != null) |
|
231 { |
|
232 nf = NumberFormat.getNumberInstance(locale); |
|
233 |
|
234 h.check(nf.format(1000L), expectedNumber4.a); |
|
235 h.check(nf.format(1000000L), expectedNumber4.b); |
|
236 h.check(nf.format(100d), expectedNumber4.c); |
|
237 h.check(nf.format(100.1234d), expectedNumber4.d); |
|
238 h.check(nf.format(10000000.1234d), expectedNumber4.e); |
|
239 } |
|
240 |
|
241 if (expectedNumberProcent != null) |
|
242 { |
|
243 nf = NumberFormat.getPercentInstance(locale); |
|
244 |
|
245 h.check(nf.format(1000L), expectedNumberProcent.a); |
|
246 h.check(nf.format(1000000L), expectedNumberProcent.b); |
|
247 h.check(nf.format(100d), expectedNumberProcent.c); |
|
248 h.check(nf.format(100.1234d), expectedNumberProcent.d); |
|
249 h.check(nf.format(10000000.1234d), expectedNumberProcent.e); |
|
250 } |
|
251 |
|
252 // Currencies |
|
253 h.checkPoint("Currencies locale: "+ locale); |
|
254 |
|
255 if (expected != null) |
|
256 { |
|
257 Currency currency = Currency.getInstance(locale); |
|
258 |
|
259 h.check(currency.getCurrencyCode(), expected.currencyCode); |
|
260 h.check(currency.getDefaultFractionDigits(), expected.currencyFractionDigits); |
|
261 h.check(currency.getSymbol(), expected.currencySymbol); |
|
262 |
|
263 try |
|
264 { |
|
265 Currency byCode = Currency.getInstance(currency.getCurrencyCode()); |
|
266 |
|
267 h.check(currency.getCurrencyCode(), byCode.getCurrencyCode()); |
|
268 h.check(currency.getDefaultFractionDigits(), byCode.getDefaultFractionDigits()); |
|
269 h.check(currency.getSymbol(), byCode.getSymbol()); |
|
270 } |
|
271 catch (IllegalArgumentException e) |
|
272 { |
|
273 h.fail("Currency code not supported: " + currency.getCurrencyCode()); |
|
274 } |
|
275 } |
|
276 } |
|
277 |
|
278 public void test(TestHarness h) |
|
279 { |
|
280 // Check all supported locales. |
|
281 |
|
282 // FIXME: Add all EURO countries. |
|
283 |
|
284 // Locale: Germany |
|
285 checkLocale(h, new Locale("de", "DE"), |
|
286 new ExpectedValues("de", "DE", "", "de_DE", "deu", "DEU", |
|
287 "Deutsch", "Deutschland", "", "Deutsch (Deutschland)", |
|
288 "EUR", 2, "EUR"), |
|
289 new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. M\u00e4rz 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
290 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
291 new ExpectedNumberValues("1.000,00 \u20ac", "1.000.000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10.000.000,12 \u20ac"), |
|
292 new ExpectedNumberValues("-1.000,00 \u20ac", "-1.000.000,00 \u20ac", "-100,00 \u20ac", "-100,12 \u20ac", "-10.000.000,12 \u20ac"), |
|
293 new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"), |
|
294 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
295 new ExpectedNumberValues("100.000%", "100.000.000%", "10.000%", "10.012%", "1.000.000.012%")); |
|
296 // Locale: Belgium |
|
297 checkLocale(h, new Locale("fr", "BE"), |
|
298 new ExpectedValues("fr", "BE", "", "fr_BE", "fra", "BEL", |
|
299 "Franz\u00f6sisch", "Belgien", "", "Franz\u00f6sisch (Belgien)", |
|
300 "EUR", 2, "EUR"), |
|
301 new ExpectedDateValues("18-mars-1974", "18/03/74", "18-mars-1974", "18 mars 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
302 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
303 new ExpectedNumberValues("1.000,00 \u20ac", "1.000.000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10.000.000,12 \u20ac"), |
|
304 new ExpectedNumberValues("-1.000,00 \u20ac", "-1.000.000,00 \u20ac", "-100,00 \u20ac", "-100,12 \u20ac", "-10.000.000,12 \u20ac"), |
|
305 new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"), |
|
306 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
307 new ExpectedNumberValues("100.000 %", "100.000.000 %", "10.000 %", "10.012 %", "1.000.000.012 %")); |
|
308 // Locale: Greece |
|
309 // FIXME: Disabled for now due to pattern problems. |
|
310 /* |
|
311 checkLocale(h, new Locale("el", "GR"), |
|
312 new ExpectedValues("el", "GR", "", "el_GR", "ell", "GRC", |
|
313 "Griechisch", "Griechenland", "", "Griechisch (Griechenland)", |
|
314 "EUR", 2, "\u20ac"), |
|
315 new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. M\u00e4rz 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
316 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
317 new ExpectedNumberValues("1.000,00 \u20ac", "1.000.000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10.000.000,12 \u20ac"), |
|
318 new ExpectedNumberValues("-1.000,00 \u20ac", "-1.000.000,00 \u20ac", "-100,00 \u20ac", "-100,12 \u20ac", "-10.000.000,12 \u20ac"), |
|
319 new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"), |
|
320 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
321 new ExpectedNumberValues("100.000%", "100.000.000%", "10.000%", "10.012%", "1.000.000.012%")); |
|
322 */ |
|
323 // Locale: Ireland |
|
324 checkLocale(h, new Locale("en", "IE"), |
|
325 new ExpectedValues("en", "IE", "", "en_IE", "eng", "IRL", |
|
326 "Englisch", "Irland", "", "Englisch (Irland)", |
|
327 "EUR", 2, "EUR"), |
|
328 new ExpectedDateValues("18-Mar-1974", "18/03/74", "18-Mar-1974", "18 March 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
329 new ExpectedNumberValues("1,000", "1,000,000", "100", "100.123", "10,000,000.123"), |
|
330 new ExpectedNumberValues("\u20ac1,000.00", "\u20ac1,000,000.00", "\u20ac100.00", "\u20ac100.12", "\u20ac10,000,000.12"), |
|
331 new ExpectedNumberValues("-\u20ac1,000.00", "-\u20ac1,000,000.00", "-\u20ac100.00", "-\u20ac100.12", "-\u20ac10,000,000.12"), |
|
332 new ExpectedNumberValues("1,000", "1,000,000", "100", "100", "10,000,000"), |
|
333 new ExpectedNumberValues("1,000", "1,000,000", "100", "100.123", "10,000,000.123"), |
|
334 new ExpectedNumberValues("100,000%", "100,000,000%", "10,000%", "10,012%", "1,000,000,012%")); |
|
335 // Locale: France |
|
336 checkLocale(h, new Locale("fr", "FR"), |
|
337 new ExpectedValues("fr", "FR", "", "fr_FR", "fra", "FRA", |
|
338 "Franz\u00f6sisch", "Frankreich", "", "Franz\u00f6sisch (Frankreich)", |
|
339 "EUR", 2, "EUR"), |
|
340 null, |
|
341 null, |
|
342 null, |
|
343 null, |
|
344 null, |
|
345 null, |
|
346 null); |
|
347 // Locale: Spain |
|
348 checkLocale(h, new Locale("es", "ES"), |
|
349 new ExpectedValues("es", "ES", "", "es_ES", "spa", "ESP", |
|
350 "Spanisch", "Spanien", "", "Spanisch (Spanien)", |
|
351 "EUR", 2, "EUR"), |
|
352 null, |
|
353 null, |
|
354 null, |
|
355 null, |
|
356 null, |
|
357 null, |
|
358 null); |
|
359 // Locale: Portugal |
|
360 checkLocale(h, new Locale("pt", "PT"), |
|
361 new ExpectedValues("pt", "PT", "", "pt_PT", "por", "PRT", |
|
362 "Portugiesisch", "Portugal", "", "Portugiesisch (Portugal)", |
|
363 "EUR", 2, "EUR"), |
|
364 null, |
|
365 null, |
|
366 null, |
|
367 null, |
|
368 null, |
|
369 null, |
|
370 null); |
|
371 // Locale: Italy |
|
372 checkLocale(h, new Locale("it", "IT"), |
|
373 new ExpectedValues("it", "IT", "", "it_IT", "ita", "ITA", |
|
374 "Italienisch", "Italien", "", "Italienisch (Italien)", |
|
375 "EUR", 2, "EUR"), |
|
376 null, |
|
377 null, |
|
378 null, |
|
379 null, |
|
380 null, |
|
381 null, |
|
382 null); |
|
383 // Locale: The Netherlands |
|
384 checkLocale(h, new Locale("nl", "NL"), |
|
385 new ExpectedValues("nl", "NL", "", "nl_NL", "nld", "NLD", |
|
386 "Niederl\u00e4ndisch", "Niederlande", "", "Niederl\u00e4ndisch (Niederlande)", |
|
387 "EUR", 2, "EUR"), |
|
388 new ExpectedDateValues("18-mrt-1974", "18-3-74", "18-mrt-1974", "18 maart 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
389 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
390 new ExpectedNumberValues("\u20ac 1.000,00", "\u20ac 1.000.000,00", "\u20ac 100,00", "\u20ac 100,12", "\u20ac 10.000.000,12"), |
|
391 new ExpectedNumberValues("\u20ac 1.000,00-", "\u20ac 1.000.000,00-", "\u20ac 100,00-", "\u20ac 100,12-", "\u20ac 10.000.000,12-"), |
|
392 new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"), |
|
393 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
394 new ExpectedNumberValues("100.000%", "100.000.000%", "10.000%", "10.012%", "1.000.000.012%")); |
|
395 // Locale: Luxemborg |
|
396 checkLocale(h, new Locale("fr", "LU"), |
|
397 new ExpectedValues("fr", "LU", "", "fr_LU", "fra", "LUX", |
|
398 "Franz\u00f6sisch", "Luxemburg", "", "Franz\u00f6sisch (Luxemburg)", |
|
399 "EUR", 2, "EUR"), |
|
400 null, |
|
401 null, |
|
402 null, |
|
403 null, |
|
404 null, |
|
405 null, |
|
406 null); |
|
407 // Locale: United Kingdom |
|
408 checkLocale(h, Locale.UK, |
|
409 new ExpectedValues("en", "GB", "", "en_GB", "eng", "GBR", |
|
410 "Englisch", "Vereinigtes K\u00f6nigreich", "", "Englisch (Vereinigtes K\u00f6nigreich)", |
|
411 "GBP", 2, "GBP"), |
|
412 new ExpectedDateValues("18-Mar-1974", "18/03/74", "18-Mar-1974", "18 March 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
413 new ExpectedNumberValues("1,000", "1,000,000", "100", "100.123", "10,000,000.123"), |
|
414 new ExpectedNumberValues("\u00a31,000.00", "\u00a31,000,000.00", "\u00a3100.00", "\u00a3100.12", "\u00a310,000,000.12"), |
|
415 new ExpectedNumberValues("-\u00a31,000.00", "-\u00a31,000,000.00", "-\u00a3100.00", "-\u00a3100.12", "-\u00a310,000,000.12"), |
|
416 new ExpectedNumberValues("1,000", "1,000,000", "100", "100", "10,000,000"), |
|
417 new ExpectedNumberValues("1,000", "1,000,000", "100", "100.123", "10,000,000.123"), |
|
418 new ExpectedNumberValues("100,000%", "100,000,000%", "10,000%", "10,012%", "1,000,000,012%")); |
|
419 // Locale: United States |
|
420 checkLocale(h, Locale.US, |
|
421 new ExpectedValues("en", "US", "", "en_US", "eng", "USA", |
|
422 "Englisch", "Vereinigte Staaten von Amerika", "", "Englisch (Vereinigte Staaten von Amerika)", |
|
423 "USD", 2, "USD"), |
|
424 new ExpectedDateValues("Mar 18, 1974", "3/18/74", "Mar 18, 1974", "March 18, 1974", "5:20:30 PM", "5:20 PM", "5:20:30 PM", "5:20:30 PM GMT"), |
|
425 new ExpectedNumberValues("1,000", "1,000,000", "100", "100.123", "10,000,000.123"), |
|
426 new ExpectedNumberValues("$1,000.00", "$1,000,000.00", "$100.00", "$100.12", "$10,000,000.12"), |
|
427 new ExpectedNumberValues("($1,000.00)", "($1,000,000.00)", "($100.00)", "($100.12)", "($10,000,000.12)"), |
|
428 new ExpectedNumberValues("1,000", "1,000,000", "100", "100", "10,000,000"), |
|
429 new ExpectedNumberValues("1,000", "1,000,000", "100", "100.123", "10,000,000.123"), |
|
430 new ExpectedNumberValues("100,000%", "100,000,000%", "10,000%", "10,012%", "1,000,000,012%")); |
|
431 // Locale: Finland |
|
432 checkLocale(h, new Locale("fi", "FI"), |
|
433 new ExpectedValues("fi", "FI", "", "fi_FI", "fin", "FIN", |
|
434 "Finnisch", "Finnland", "", "Finnisch (Finnland)", |
|
435 "EUR", 2, "EUR"), |
|
436 new ExpectedDateValues("18.3.1974", "18.3.1974", "18.3.1974", "18. maaliskuuta 1974", "17:20:30", "17:20", "17:20:30", "klo 17.20.30"), |
|
437 new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100,123", "10\u00a0000\u00a0000,123"), |
|
438 new ExpectedNumberValues("1\u00a0000,00 \u20ac", "1\u00a0000\u00a0000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10\u00a0000\u00a0000,12 \u20ac"), |
|
439 new ExpectedNumberValues("-1\u00a0000,00 \u20ac", "-1\u00a0000\u00a0000,00 \u20ac", "-100,00 \u20ac", "-100,12 \u20ac", "-10\u00a0000\u00a0000,12 \u20ac"), |
|
440 new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100", "10\u00a0000\u00a0000"), |
|
441 new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100,123", "10\u00a0000\u00a0000,123"), |
|
442 new ExpectedNumberValues("100\u00a0000%", "100\u00a0000\u00a0000%", "10\u00a0000%", "10\u00a0012%", "1\u00a0000\u00a0000\u00a0012%")); |
|
443 // Locale: Turkey |
|
444 checkLocale(h, new Locale("tr", "TR"), |
|
445 new ExpectedValues("tr", "TR", "", "tr_TR", "tur", "TUR", |
|
446 "T\u00fcrkisch", "T\u00fcrkei", "", "T\u00fcrkisch (T\u00fcrkei)", |
|
447 "TRY", 2, "TRY"), |
|
448 new ExpectedDateValues("18.Mar.1974", "18.03.1974", "18.Mar.1974", "18 Mart 1974 Pazartesi", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
449 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
450 new ExpectedNumberValues("1.000,00 YTL", "1.000.000,00 YTL", "100,00 YTL", "100,12 YTL", "10.000.000,12 YTL"), |
|
451 new ExpectedNumberValues("-1.000,00 YTL", "-1.000.000,00 YTL", "-100,00 YTL", "-100,12 YTL", "-10.000.000,12 YTL"), |
|
452 new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"), |
|
453 new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"), |
|
454 new ExpectedNumberValues("% 100.000", "% 100.000.000", "% 10.000", "% 10.012", "% 1.000.000.012")); |
|
455 // Locale: Kazakstan |
|
456 checkLocale(h, new Locale("kk", "KZ"), |
|
457 new ExpectedValues("kk", "KZ", "", "kk_KZ", "kaz", "KAZ", |
|
458 "Kasachisch", "Kasachstan", "", "Kasachisch (Kasachstan)", |
|
459 "KZT", 2, "KZT"), |
|
460 null, |
|
461 null, |
|
462 null, |
|
463 null, |
|
464 null, |
|
465 null, |
|
466 null); |
|
467 // Locale: Estonia |
|
468 checkLocale(h, new Locale("et", "EE"), |
|
469 new ExpectedValues("et", "EE", "", "et_EE", "est", "EST", |
|
470 "Estnisch", "Estland", "", "Estnisch (Estland)", |
|
471 "EEK", 2, "EEK"), |
|
472 new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "esmasp\u00e4ev, 18. M\u00e4rts 1974. a", "17:20:30", "17:20", "17:20:30", "17:20:30 GMT"), |
|
473 new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100,123", "10\u00a0000\u00a0000,123"), |
|
474 new ExpectedNumberValues("1\u00a0000 kr", "1\u00a0000\u00a0000 kr", "100 kr", "100,12 kr", "10\u00a0000\u00a0000,12 kr"), |
|
475 new ExpectedNumberValues("-1\u00a0000 kr", "-1\u00a0000\u00a0000 kr", "-100 kr", "-100,12 kr", "-10\u00a0000\u00a0000,12 kr"), |
|
476 new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100", "10\u00a0000\u00a0000"), |
|
477 new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100,123", "10\u00a0000\u00a0000,123"), |
|
478 new ExpectedNumberValues("100\u00a0000%", "100\u00a0000\u00a0000%", "10\u00a0000%", "10\u00a0012%", "1\u00a0000\u00a0000\u00a0012%")); |
|
479 } |
|
480 } |
|
481 |
|