mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-7785 Workaround for Java TimeZoneNameProvider behavior problem in TimeZoneNameTest.
X-SVN-Rev: 28262
This commit is contained in:
parent
5064cc8b48
commit
2f2cd0b5d0
1 changed files with 14 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2008-2009, International Business Machines Corporation and *
|
||||
* Copyright (C) 2008-2010, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -27,15 +27,22 @@ public class TimeZoneNameTest extends TestFmwk {
|
|||
if (TestUtil.isProblematicIBMLocale(loc)) {
|
||||
warningOnly = true;
|
||||
}
|
||||
else if ((TestUtil.isSUNJRE() || TestUtil.isIBMJRE()) && loc.toString().startsWith("eu")) {
|
||||
warningOnly = true;
|
||||
}
|
||||
|
||||
for (String tzid : tzids) {
|
||||
TimeZone tz = TimeZone.getTimeZone(tzid);
|
||||
com.ibm.icu.util.TimeZone tzIcu = com.ibm.icu.util.TimeZone.getTimeZone(tzid);
|
||||
checkDisplayNamePair(TimeZone.SHORT, tz, tzIcu, loc, warningOnly);
|
||||
checkDisplayNamePair(TimeZone.LONG, tz, tzIcu, loc, warningOnly);
|
||||
|
||||
// Java does not pick up time zone names for ID/Locale from an SPI
|
||||
// when long standard display name is not available.
|
||||
|
||||
String icuStdLong = getIcuDisplayName(tzIcu, false, TimeZone.LONG, loc);
|
||||
if (icuStdLong != null) {
|
||||
TimeZone tz = TimeZone.getTimeZone(tzid);
|
||||
checkDisplayNamePair(TimeZone.SHORT, tz, tzIcu, loc, warningOnly);
|
||||
checkDisplayNamePair(TimeZone.LONG, tz, tzIcu, loc, warningOnly);
|
||||
} else {
|
||||
logln("Localized long standard name is not available for "
|
||||
+ tzid + " in locale " + loc + " in ICU");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue