30 |
|
|
31 |
public class TestTranslations { |
public class TestTranslations { |
32 |
|
|
33 |
private static Map<Locale,String[]> KYIV; |
private static Map<Locale,String[]> KYIV, CIUDAD_JUAREZ; |
34 |
|
|
35 |
static { |
static { |
36 |
Map<Locale,String[]> map = new HashMap<Locale,String[]>(); |
Map<Locale,String[]> map = new HashMap<Locale,String[]>(); |
44 |
"Osteurop\u00e4ische Sommerzeit", "OESZ", "OESZ", |
"Osteurop\u00e4ische Sommerzeit", "OESZ", "OESZ", |
45 |
"Osteurop\u00e4ische Zeit", "OEZ", "OEZ"}); |
"Osteurop\u00e4ische Zeit", "OEZ", "OEZ"}); |
46 |
KYIV = Collections.unmodifiableMap(map); |
KYIV = Collections.unmodifiableMap(map); |
47 |
|
|
48 |
|
map = new HashMap<Locale,String[]>(); |
49 |
|
map.put(Locale.US, new String[] { "Mountain Standard Time", "MST", "MST", |
50 |
|
"Mountain Daylight Time", "MDT", "MDT", |
51 |
|
"Mountain Time", "MT", "MT"}); |
52 |
|
map.put(Locale.FRANCE, new String[] { "Heure normale des Rocheuses", "UTC\u221207:00", "MST", |
53 |
|
"Heure avanc\u00e9e des Rocheuses", "UTC\u221206:00", "MDT", |
54 |
|
"Rocheuses", "UTC\u221207:00", "MT"}); |
55 |
|
map.put(Locale.GERMANY, new String[] { "Rocky Mountains Normalzeit", "GMT-07:00", "MST", |
56 |
|
"Rocky Mountains Sommerzeit", "GMT-06:00", "MDT", |
57 |
|
"Zeitzone Mountain", "GMT-07:00", "MT"}); |
58 |
|
CIUDAD_JUAREZ = Collections.unmodifiableMap(map); |
59 |
} |
} |
60 |
|
|
61 |
|
|
65 |
System.exit(1); |
System.exit(1); |
66 |
} |
} |
67 |
|
|
|
String localeProvider = args[0]; |
|
68 |
System.out.println("Checking sanity of full zone string set..."); |
System.out.println("Checking sanity of full zone string set..."); |
69 |
boolean invalid = Arrays.stream(Locale.getAvailableLocales()) |
boolean invalid = Arrays.stream(Locale.getAvailableLocales()) |
70 |
.peek(l -> System.out.println("Locale: " + l)) |
.peek(l -> System.out.println("Locale: " + l)) |
79 |
System.exit(2); |
System.exit(2); |
80 |
} |
} |
81 |
|
|
82 |
for (Locale l : KYIV.keySet()) { |
String localeProvider = args[0]; |
83 |
String[] expected = KYIV.get(l); |
testZone(localeProvider, KYIV, |
84 |
for (String id : new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }) { |
new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }); |
85 |
|
testZone(localeProvider, CIUDAD_JUAREZ, |
86 |
|
new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" }); |
87 |
|
} |
88 |
|
|
89 |
|
private static void testZone(String localeProvider, Map<Locale,String[]> exp, String[] ids) { |
90 |
|
for (Locale l : exp.keySet()) { |
91 |
|
String[] expected = exp.get(l); |
92 |
|
System.out.printf("Expected values for %s are %s\n", l, Arrays.toString(expected)); |
93 |
|
for (String id : ids) { |
94 |
String expectedShortStd = null; |
String expectedShortStd = null; |
95 |
String expectedShortDST = null; |
String expectedShortDST = null; |
96 |
String expectedShortGen = null; |
String expectedShortGen = null; |