Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/sun/util/resources/TimeZone/Bug6317929.java
41154 views
1
/*
2
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
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
*
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.
22
*/
23
24
/*
25
* @test
26
* @bug 6317929 6409419 8008577
27
* @modules jdk.localedata
28
* @summary Test case for tzdata2005m support for 9 locales
29
* @run main/othervm -Djava.locale.providers=JRE,SPI Bug6317929
30
*/
31
32
import java.util.Locale;
33
import java.util.TimeZone;
34
35
public class Bug6317929 {
36
static Locale[] locales2Test = new Locale[] {
37
new Locale("en"),
38
new Locale("de"),
39
new Locale("es"),
40
new Locale("fr"),
41
new Locale("it"),
42
new Locale("ja"),
43
new Locale("ko"),
44
new Locale("sv"),
45
new Locale("zh","CN"),
46
new Locale("zh","TW")
47
};
48
49
public static void main(String[] args) {
50
Locale tzLocale;
51
52
TimeZone Coral_Harbour = TimeZone.getTimeZone("America/Coral_Harbour");
53
tzLocale = locales2Test[0];
54
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
55
("Eastern Standard Time"))
56
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
57
"non-daylight saving name for " +
58
"America/Coral_Harbour should be " +
59
"\"Eastern Standard Time\"");
60
tzLocale = locales2Test[1];
61
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
62
("\u00d6stliche Normalzeit"))
63
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
64
"non-daylight saving name for " +
65
"America/Coral_Harbour should be " +
66
"\"\u00d6stliche Normalzeit\"");
67
tzLocale = locales2Test[2];
68
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
69
("Hora est\u00e1ndar Oriental"))
70
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
71
"non-daylight saving name for " +
72
"America/Coral_Harbour should be " +
73
"\"Hora est\u00e1ndar Oriental\"");
74
tzLocale = locales2Test[3];
75
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
76
("Heure normale de l'Est"))
77
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
78
"non-daylight saving name for " +
79
"America/Coral_Harbour should be " +
80
"\"Heure normale de l'Est\"");
81
tzLocale = locales2Test[4];
82
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
83
("Ora solare USA orientale"))
84
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
85
"non-daylight saving name for " +
86
"America/Coral_Harbour should be " +
87
"\"Ora solare USA orientale\"");
88
tzLocale = locales2Test[5];
89
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
90
("\u6771\u90e8\u6a19\u6e96\u6642"))
91
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
92
"non-daylight saving name for " +
93
"America/Coral_Harbour should be " +
94
"\"\u6771\u90e8\u6a19\u6e96\u6642\"");
95
tzLocale = locales2Test[6];
96
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
97
("\ub3d9\ubd80 \ud45c\uc900\uc2dc"))
98
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
99
"non-daylight saving name for " +
100
"America/Coral_Harbour should be " +
101
"\"\ub3d9\ubd80 \ud45c\uc900\uc2dc\"");
102
tzLocale = locales2Test[7];
103
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
104
("Eastern, normaltid"))
105
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
106
"non-daylight saving name for " +
107
"America/Coral_Harbour should be " +
108
"\"Eastern, normaltid\"");
109
tzLocale = locales2Test[8];
110
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
111
("\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4"))
112
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
113
"non-daylight saving name for " +
114
"America/Coral_Harbour should be " +
115
"\"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\"");
116
tzLocale = locales2Test[9];
117
if (!Coral_Harbour.getDisplayName(false, TimeZone.LONG, tzLocale).equals
118
("\u6771\u65b9\u6a19\u6e96\u6642\u9593"))
119
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
120
"non-daylight saving name for " +
121
"America/Coral_Harbour should be " +
122
"\"\u6771\u65b9\u6a19\u6e96\u6642\u9593\"");
123
124
TimeZone Currie = TimeZone.getTimeZone("Australia/Currie");
125
tzLocale = locales2Test[0];
126
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
127
("Australian Eastern Standard Time (New South Wales)"))
128
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
129
"non-daylight saving name for " +
130
"Australia/Currie should be " +
131
"\"Australian Eastern Standard Time " +
132
"(New South Wales)\"");
133
tzLocale = locales2Test[1];
134
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
135
("\u00D6stliche Normalzeit (New South Wales)"))
136
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
137
"non-daylight saving name for " +
138
"Australia/Currie should be " +
139
"\"\u00D6stliche Normalzeit " +
140
"(New South Wales)\"");
141
tzLocale = locales2Test[2];
142
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
143
("Hora est\u00e1ndar Oriental (Nueva Gales del Sur)"))
144
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
145
"non-daylight saving name for " +
146
"Australia/Currie should be " +
147
"\"Hora est\u00e1ndar Oriental " +
148
"(Nueva Gales del Sur)\"");
149
tzLocale = locales2Test[3];
150
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
151
("Heure normale de l'Est (Nouvelle-Galles du Sud)"))
152
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
153
"non-daylight saving name for " +
154
"Australia/Currie should be " +
155
"\"Heure normale de l'Est " +
156
"(Nouvelle-Galles du Sud)\"");
157
tzLocale = locales2Test[4];
158
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
159
("Ora standard dell'Australia orientale (Nuovo Galles del Sud)"))
160
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
161
"non-daylight saving name for " +
162
"Australia/Currie should be " +
163
"\"Ora standard dell'Australia orientale " +
164
"(Nuovo Galles del Sud)\"");
165
tzLocale = locales2Test[5];
166
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
167
("\u6771\u90E8\u6A19\u6E96\u6642" +
168
"(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA)"))
169
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
170
"non-daylight saving name for " +
171
"Australia/Currie should be " +
172
"\"\u6771\u90E8\u6A19\u6E96\u6642" +
173
"(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9" +
174
"\u30A6\u30A7\u30FC\u30EB\u30BA)\"");
175
tzLocale = locales2Test[6];
176
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
177
("\uB3D9\uBD80 \uD45C\uC900\uC2DC(\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)"))
178
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
179
"non-daylight saving name for " +
180
"Australia/Currie should be " +
181
"\"\uB3D9\uBD80 \uD45C\uC900\uC2DC" +
182
"(\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)\"");
183
tzLocale = locales2Test[7];
184
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
185
("\u00D6stlig standardtid (New South Wales)"))
186
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
187
"non-daylight saving name for " +
188
"Australia/Currie should be " +
189
"\"\u00D6stlig standardtid " +
190
"(New South Wales)\"");
191
tzLocale = locales2Test[8];
192
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
193
("\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 (\u65B0\u5357\u5A01\u5C14\u65AF)"))
194
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
195
"non-daylight saving name for " +
196
"Australia/Currie should be " +
197
"\"\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 " +
198
"(\u65B0\u5357\u5A01\u5C14\u65AF)\"");
199
tzLocale = locales2Test[9];
200
if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
201
("\u6771\u90E8\u6A19\u6E96\u6642\u9593 (\u65B0\u5357\u5A01\u723E\u65AF)"))
202
throw new RuntimeException("\n" + tzLocale + ": LONG, " +
203
"non-daylight saving name for " +
204
"Australia/Currie should be " +
205
"\"\u6771\u90E8\u6A19\u6E96\u6642\u9593 " +
206
"(\u65B0\u5357\u5A01\u723E\u65AF)\"");
207
}
208
}
209
210