ICU-9680 Updated TestTimeZoneNames to match the workaround for Java's TimeZoneNameProvider support problem done by #9400.

X-SVN-Rev: 32656
This commit is contained in:
Yoshito Umaoka 2012-10-18 16:58:09 +00:00
parent 9306ec4e68
commit 3eeef3b050

View file

@ -30,11 +30,16 @@ public class TimeZoneNameTest extends TestFmwk {
}
for (String tzid : tzids) {
// Java does not pick up time zone names for ID/Locale from an SPI
// when long standard display name is not available.
// Java has a problem when a provider does not supply all 4 names
// for a zone. For this reason, ICU TimeZoneName provider does not return
// localized names unless these 4 names are available.
String icuStdLong = getIcuDisplayName(tzid, false, TimeZone.LONG, loc);
if (icuStdLong != null) {
String icuDstLong = getIcuDisplayName(tzid, true, TimeZone.LONG, loc);
String icuStdShort = getIcuDisplayName(tzid, false, TimeZone.SHORT, loc);
String icuDstShort = getIcuDisplayName(tzid, true, TimeZone.SHORT, loc);
if (icuStdLong != null && icuDstLong != null && icuStdShort != null && icuDstShort != null) {
checkDisplayNamePair(TimeZone.SHORT, tzid, loc, warningOnly);
checkDisplayNamePair(TimeZone.LONG, tzid, loc, warningOnly);
} else {