< prev index next >
test/jdk/java/util/TimeZone/CLDRDisplayNamesTest.java
Print this page
rev 57986 : 8234347: "Turkey" meta time zone does not generate composed localized names
8236548: Localized time zone name inconsistency between English and other locales
Reviewed-by:
*** 1,7 ****
/*
! * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 22,31 ****
--- 22,32 ----
*/
/*
* @test
* @bug 8005471 8008577 8129881 8130845 8136518 8181157 8210490 8220037
+ * 8234347 8236548
* @modules jdk.localedata
* @run main/othervm -Djava.locale.providers=CLDR CLDRDisplayNamesTest
* @summary Make sure that localized time zone names of CLDR are used
* if specified.
*/
*** 93,117 ****
}
}
}
// for 8129881
tz = TimeZone.getTimeZone("Europe/Vienna");
String name = tz.getDisplayName(false, SHORT, Locale.ENGLISH);
if (!"CET".equals(name)) {
System.err.printf("error: got '%s' expected 'CET' %n", name);
errors++;
}
// for 8130845
SimpleDateFormat fmtROOT = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy", Locale.ROOT);
SimpleDateFormat fmtUS = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy", Locale.US);
SimpleDateFormat fmtUK = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy", Locale.UK);
Locale originalLocale = Locale.getDefault();
try {
Locale.setDefault(Locale.ROOT);
! fmtROOT.parse("Thu Nov 13 04:35:51 AKST 2008");
fmtUS.parse("Thu Nov 13 04:35:51 AKST 2008");
fmtUK.parse("Thu Nov 13 04:35:51 GMT-09:00 2008");
} catch (ParseException pe) {
System.err.println(pe);
errors++;
--- 94,120 ----
}
}
}
// for 8129881
+ /* 8234347: CLDR Converter will not pre-fill short display names from COMPAT anymore.
tz = TimeZone.getTimeZone("Europe/Vienna");
String name = tz.getDisplayName(false, SHORT, Locale.ENGLISH);
if (!"CET".equals(name)) {
System.err.printf("error: got '%s' expected 'CET' %n", name);
errors++;
}
+ */
// for 8130845
SimpleDateFormat fmtROOT = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy", Locale.ROOT);
SimpleDateFormat fmtUS = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy", Locale.US);
SimpleDateFormat fmtUK = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy", Locale.UK);
Locale originalLocale = Locale.getDefault();
try {
Locale.setDefault(Locale.ROOT);
! fmtROOT.parse("Thu Nov 13 04:35:51 GMT-09:00 2008");
fmtUS.parse("Thu Nov 13 04:35:51 AKST 2008");
fmtUK.parse("Thu Nov 13 04:35:51 GMT-09:00 2008");
} catch (ParseException pe) {
System.err.println(pe);
errors++;
*** 152,170 ****
--- 155,175 ----
})
.count();
// 8220037: Make sure CLDRConverter uniquely produces bundles, regardless of the
// source file enumeration order.
+ /* 8234347: CLDR Converter will not pre-fill short display names from COMPAT anymore.
tz = TimeZone.getTimeZone("America/Argentina/La_Rioja");
if (!"ARST".equals(tz.getDisplayName(true, TimeZone.SHORT,
new Locale.Builder()
.setLanguage("en")
.setRegion("CA")
.build()))) {
System.err.println("Short display name of \"" + tz.getID() + "\" was not \"ARST\"");
errors++;
}
+ */
if (errors > 0) {
throw new RuntimeException("test failed");
}
}
< prev index next >