From 3eeef3b050e1d7627a2921f03b4a41ef698bf6ea Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Thu, 18 Oct 2012 16:58:09 +0000 Subject: [PATCH] ICU-9680 Updated TestTimeZoneNames to match the workaround for Java's TimeZoneNameProvider support problem done by #9400. X-SVN-Rev: 32656 --- .../ibm/icu/dev/test/localespi/TimeZoneNameTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/TimeZoneNameTest.java b/icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/TimeZoneNameTest.java index 42ee22c7301..08180d151e0 100644 --- a/icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/TimeZoneNameTest.java +++ b/icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/TimeZoneNameTest.java @@ -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 { -- 2.49.0