author | okutsu |
Fri, 27 May 2016 14:33:48 +0900 | |
changeset 38581 | e761c1ccd13e |
permissions | -rw-r--r-- |
38581
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
1 |
/* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
2 |
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
4 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
8 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
13 |
* accompanied this code). |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
14 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
18 |
* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
21 |
* questions. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
22 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
23 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
24 |
/* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
25 |
* @test |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
26 |
* @bug 6405639 8008577 |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
27 |
* @summary Validate timezone display names in |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
28 |
* src/java.base/share/classes/sun/util/resources/TimeZoneNames.java. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
29 |
* @modules java.base/sun.util.resources |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
30 |
* @compile -XDignore.symbol.file CheckDisplayNames.java |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
31 |
* @run main/othervm -Djava.locale.providers=COMPAT,SPI CheckDisplayNames |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
32 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
33 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
34 |
import java.util.*; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
35 |
import sun.util.resources.TimeZoneNames; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
36 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
37 |
/** |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
38 |
* CheckDisplayNames checks all available time zones in the Java run |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
39 |
* time environment and sees if those have their display names besides doing |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
40 |
* some other test cases. It outputs time zones that don't have display names |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
41 |
* if -source option is specified. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
42 |
* <blockquote> |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
43 |
* <pre> |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
44 |
* Usage: java CheckDisplayNames [-source] |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
45 |
* -source ... produces source code for editing TimeZoneNames.java. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
46 |
* </pre> |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
47 |
* </blockquote> |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
48 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
49 |
public class CheckDisplayNames { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
50 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
51 |
private static boolean err = false; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
52 |
private static boolean src = false; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
53 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
54 |
private static Locale[] locales = Locale.getAvailableLocales(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
55 |
private static String[] zones = TimeZone.getAvailableIDs(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
56 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
57 |
private static String[] zones_118 = { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
58 |
"ACT", "Australia/Darwin", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
59 |
"AET", "Australia/Sydney", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
60 |
"AGT", "America/Buenos_Aires", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
61 |
"ART", "Africa/Cairo", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
62 |
"AST", "America/Anchorage", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
63 |
"BET", "America/Sao_Paulo", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
64 |
"BST", "Asia/Dacca", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
65 |
"CAT", "Africa/Harare", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
66 |
"CNT", "America/St_Johns", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
67 |
"CST", "America/Chicago", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
68 |
"CTT", "Asia/Shanghai", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
69 |
"EAT", "Africa/Addis_Ababa", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
70 |
"ECT", "Europe/Paris", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
71 |
// "EET", "Africa/Istanbul", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
72 |
"EST", "America/New_York", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
73 |
"HST", "Pacific/Honolulu", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
74 |
"IET", "America/Indiana/Indianapolis", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
75 |
// Comment out for this test case fails as the result of L10N for hi_IN. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
76 |
// "IST", "Asia/Calcutta", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
77 |
"JST", "Asia/Tokyo", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
78 |
// "MET", "Asia/Tehran", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
79 |
"MIT", "Pacific/Apia", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
80 |
"MST", "America/Denver", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
81 |
"NET", "Asia/Yerevan", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
82 |
"NST", "Pacific/Auckland", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
83 |
"PLT", "Asia/Karachi", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
84 |
"PNT", "America/Phoenix", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
85 |
"PRT", "America/Puerto_Rico", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
86 |
"PST", "America/Los_Angeles", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
87 |
"SST", "Pacific/Guadalcanal", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
88 |
"VST", "Asia/Saigon", |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
89 |
}; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
90 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
91 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
92 |
public static void main(String[] argv) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
93 |
Locale reservedLocale = Locale.getDefault(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
94 |
try { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
95 |
if (argv.length == 1 && "-source".equals(argv[0])) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
96 |
src = true; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
97 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
98 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
99 |
testDisplayNames(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
100 |
testRAWoffsetAndDisplayNames(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
101 |
test118DisplayNames(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
102 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
103 |
if (err) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
104 |
throw new RuntimeException( |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
105 |
"TimeZone display name validation failed."); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
106 |
} else { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
107 |
System.out.println( |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
108 |
"\nAll test passed.\nTotal number of valid TimeZone id is " |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
109 |
+ zones.length); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
110 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
111 |
} finally { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
112 |
// restore the reserved locale |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
113 |
Locale.setDefault(reservedLocale); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
114 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
115 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
116 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
117 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
118 |
/* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
119 |
* Checks if each timezone ID has display names. If it doesn't and |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
120 |
* "-source" option was specified, source code is generated. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
121 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
122 |
private static void testDisplayNames() { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
123 |
System.out.println("Checking if each entry in TimeZoneNames is a valid TimeZone ID"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
124 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
125 |
Locale.setDefault(Locale.US); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
126 |
Enumeration data = new TimeZoneNames().getKeys(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
127 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
128 |
while (data.hasMoreElements()) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
129 |
String name = (String)data.nextElement(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
130 |
String id = TimeZone.getTimeZone(name).getID(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
131 |
if (!name.equals(id)) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
132 |
System.err.println("\t" + name + " doesn't seem to be a valid TimeZone ID."); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
133 |
err = true; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
134 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
135 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
136 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
137 |
System.out.println("Checking if each TimeZone ID has display names."); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
138 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
139 |
for (int i = 0; i < zones.length; i++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
140 |
String id = zones[i]; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
141 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
142 |
if (id != null) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
143 |
if (id.startsWith("Etc/GMT")) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
144 |
continue; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
145 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
146 |
if (id.indexOf("Riyadh8") != -1) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
147 |
continue; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
148 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
149 |
if (id.equals("GMT0")) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
150 |
continue; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
151 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
152 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
153 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
154 |
TimeZone tz = TimeZone.getTimeZone(id); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
155 |
String name = tz.getDisplayName(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
156 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
157 |
if (name == null || name.startsWith("GMT+") || name.startsWith("GMT-")) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
158 |
if (src) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
159 |
System.out.println("\t {\"" + tz.getID() + "\", " + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
160 |
"new String[] {\"Standard Time Name\", \"ST\",\n" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
161 |
"\t\t\t\t\t\t\"Daylight Time Name\", \"DT\"}},"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
162 |
} else { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
163 |
System.err.println("\t" + tz.getID() + " doesn't seem to have display names"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
164 |
err = true; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
165 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
166 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
167 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
168 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
169 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
170 |
/* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
171 |
* Compares |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
172 |
* - raw DST offset |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
173 |
* - short display names in non-DST |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
174 |
* - short display names in DST |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
175 |
* - long display names in DST |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
176 |
* of two timezones whose long display names in non-DST are same. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
177 |
* If one of these are different, there may be a bug. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
178 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
179 |
private static void testRAWoffsetAndDisplayNames() { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
180 |
System.out.println("Checking if each entry in TimeZoneNames is a valid TimeZone ID"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
181 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
182 |
HashMap<String, TimeZone> map = new HashMap<String, TimeZone>(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
183 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
184 |
for (int i = 0; i < locales.length; i++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
185 |
map.clear(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
186 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
187 |
for (int j = 0; j < zones.length; j++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
188 |
TimeZone tz1 = TimeZone.getTimeZone(zones[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
189 |
String name = tz1.getDisplayName(false, TimeZone.LONG, locales[i]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
190 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
191 |
if (map.containsKey(name)) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
192 |
TimeZone tz2 = map.get(name); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
193 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
194 |
int offset1 = tz1.getRawOffset(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
195 |
int offset2 = tz2.getRawOffset(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
196 |
if (offset1 != offset2) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
197 |
System.err.println("Two timezones which have the same long display name \"" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
198 |
name + "\" in non-DST have different DST offsets in " + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
199 |
locales[i] + " locale.\n\tTimezone 1=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
200 |
tz1.getID() + "(" + offset1 + ")\n\tTimezone 2=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
201 |
tz2.getID() + "(" + offset2 + ")"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
202 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
203 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
204 |
String name1 = tz1.getDisplayName(false, TimeZone.SHORT, locales[i]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
205 |
String name2 = tz2.getDisplayName(false, TimeZone.SHORT, locales[i]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
206 |
if (!(name1.equals("GMT") && name2.equals("GMT")) && |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
207 |
!(name1.equals("CET") && name2.equals("MET")) && |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
208 |
!(name1.equals("MET") && name2.equals("CET"))) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
209 |
if (!name1.equals(name2)) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
210 |
System.err.println("Two timezones which have the same short display name \"" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
211 |
name + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
212 |
"\" in non-DST have different short display names in non-DST in " + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
213 |
locales[i] + " locale.\n\tTimezone 1=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
214 |
tz1.getID() + "(" + name1 + ")\n\tTimezone 2=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
215 |
tz2.getID() + "(" + name2 + ")"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
216 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
217 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
218 |
name1 = tz1.getDisplayName(true, TimeZone.SHORT, locales[i]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
219 |
name2 = tz2.getDisplayName(true, TimeZone.SHORT, locales[i]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
220 |
if (!name1.equals(name2)) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
221 |
System.err.println("Two timezones which have the same short display name \"" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
222 |
name + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
223 |
"\" in non-DST have different short display names in DST in " + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
224 |
locales[i] + " locale.\n\tTimezone 1=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
225 |
tz1.getID() + "(" + name1 + ")\n\tTimezone 2=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
226 |
tz2.getID() + "(" + name2 + ")"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
227 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
228 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
229 |
name1 = tz1.getDisplayName(true, TimeZone.LONG, locales[i]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
230 |
name2 = tz2.getDisplayName(true, TimeZone.LONG, locales[i]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
231 |
if (!name1.equals(name2)) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
232 |
System.err.println("Two timezones which have the same long display name \"" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
233 |
name + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
234 |
"\" in non-DST have different long display names in DST in " + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
235 |
locales[i] + " locale.\n\tTimezone 1=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
236 |
tz1.getID() + "(" + name1 + ")\n\tTimezone 2=" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
237 |
tz2.getID() + "(" + name2 + ")"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
238 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
239 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
240 |
} else { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
241 |
map.put(name, tz1); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
242 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
243 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
244 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
245 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
246 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
247 |
/* |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
248 |
* Compares three-letter timezones' display names with corresponding |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
249 |
* "popular" timezones. |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
250 |
*/ |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
251 |
private static void test118DisplayNames() { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
252 |
System.out.println("Checking compatibility of Java 1.1.X's three-letter timezones"); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
253 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
254 |
for (int i = 0; i < zones_118.length; i+=2) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
255 |
String id_118 = zones_118[i]; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
256 |
String id_later = zones_118[i+1]; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
257 |
String zone_118, zone_later, localename; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
258 |
TimeZone tz_118 = TimeZone.getTimeZone(id_118); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
259 |
TimeZone tz_later = TimeZone.getTimeZone(id_later); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
260 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
261 |
for (int j = 0; j < locales.length; j++) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
262 |
localename = locales[j].toString(); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
263 |
zone_118 = tz_118.getDisplayName(false, TimeZone.SHORT, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
264 |
zone_later = tz_later.getDisplayName(false, TimeZone.SHORT, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
265 |
check(id_118, id_later, zone_118, zone_later, "short", "non-DST", localename); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
266 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
267 |
zone_118 = tz_118.getDisplayName(true, TimeZone.SHORT, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
268 |
zone_later = tz_later.getDisplayName(true, TimeZone.SHORT, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
269 |
check(id_118, id_later, zone_118, zone_later, "short", "DST", localename); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
270 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
271 |
zone_118 = tz_118.getDisplayName(false, TimeZone.LONG, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
272 |
zone_later = tz_later.getDisplayName(false, TimeZone.LONG, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
273 |
check(id_118, id_later, zone_118, zone_later, "long", "non-DST", localename); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
274 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
275 |
zone_118 = tz_118.getDisplayName(true, TimeZone.LONG, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
276 |
zone_later = tz_later.getDisplayName(true, TimeZone.LONG, locales[j]); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
277 |
check(id_118, id_later, zone_118, zone_later, "long", "DST", localename); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
278 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
279 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
280 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
281 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
282 |
private static void check(String zoneID_118, String zoneID_later, |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
283 |
String zonename_118, String zonename_later, |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
284 |
String format, String dst, String loc) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
285 |
if (!zonename_118.equals(zonename_later)) { |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
286 |
System.err.println("JDK 118 TimeZone \"" + zoneID_118 + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
287 |
"\" has a different " + format + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
288 |
" display name from its equivalent timezone \"" + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
289 |
zoneID_later + "\" in " + dst + " in " + loc + " locale."); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
290 |
System.err.println(" Got: " + zonename_118 + ", Expected: " + |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
291 |
zonename_later); |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
292 |
err = true; |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
293 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
294 |
} |
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
295 |
|
e761c1ccd13e
8031145: Re-examine closed i18n tests to see it they can be moved to the jdk repository.
okutsu
parents:
diff
changeset
|
296 |
} |