ICU-8967 Updated the tzdata to 2011n and fixed failing test cases.

X-SVN-Rev: 31021
This commit is contained in:
Yoshito Umaoka 2011-12-04 22:09:02 +00:00
parent 59eb68f79d
commit 7a368871b4
3 changed files with 33 additions and 12 deletions

View file

@ -1,7 +1,7 @@
//##header
/*
*******************************************************************************
* Copyright (C) 1996-2008, International Business Machines Corporation and *
* Copyright (C) 1996-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*
@ -9,6 +9,7 @@
package com.ibm.icu.dev.test.serializable;
import java.util.Date;
import java.util.Locale;
import java.util.HashMap;
@ -20,7 +21,9 @@ import com.ibm.icu.impl.OlsonTimeZone;
import com.ibm.icu.impl.TimeZoneAdapter;
import com.ibm.icu.math.BigDecimal;
import com.ibm.icu.math.MathContext;
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.Currency;
import com.ibm.icu.util.GregorianCalendar;
import com.ibm.icu.util.SimpleTimeZone;
import com.ibm.icu.util.TimeZone;
import com.ibm.icu.util.ULocale;
@ -303,14 +306,32 @@ public class SerializableTest extends TestFmwk.TestGroup
public boolean hasSameBehavior(Object a, Object b)
{
GregorianCalendar cal = new GregorianCalendar();
TimeZoneAdapter tza_a = (TimeZoneAdapter) a;
TimeZoneAdapter tza_b = (TimeZoneAdapter) b;
if (!tza_a.getID().equals(tza_b.getID())
|| tza_a.getRawOffset() != tza_b.getRawOffset()) {
return false;
int a_offset, b_offset;
boolean a_dst, b_dst;
boolean bSame = true;
for (int i = 0; i < sampleTimes.length; i++) {
cal.setTimeInMillis(sampleTimes[i]);
int era = cal.get(Calendar.ERA);
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);
int dow = cal.get(Calendar.DAY_OF_WEEK);
int mid = cal.get(Calendar.MILLISECONDS_IN_DAY);
a_offset = tza_a.getOffset(era, year, month, day, dow, mid);
b_offset = tza_b.getOffset(era, year, month, day, dow, mid);
Date d = new Date(sampleTimes[i]);
a_dst = tza_a.inDaylightTime(d);
b_dst = tza_b.inDaylightTime(d);
if (a_offset != b_offset || a_dst != b_dst) {
bSame = false;
break;
}
}
return true;
return bSame;
}
}

View file

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 2000-2008, International Business Machines Corporation and *
* Copyright (C) 2000-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -102,7 +102,7 @@ public class TimeZoneTest extends TestFmwk
public void TestShortZoneIDs() throws Exception {
ZoneDescriptor[] JDK_116_REFERENCE_LIST = {
new ZoneDescriptor("MIT", -660, false),
new ZoneDescriptor("MIT", -660, true), // as of 2011n
new ZoneDescriptor("HST", -600, false),
new ZoneDescriptor("AST", -540, true),
new ZoneDescriptor("PST", -480, true),
@ -113,7 +113,7 @@ public class TimeZoneTest extends TestFmwk
new ZoneDescriptor("EST", -300, false),// updated Aug 2003 aliu
new ZoneDescriptor("PRT", -240, false),
new ZoneDescriptor("CNT", -210, true),
new ZoneDescriptor("AGT", -180, true), // updated by tzdata 2007k
new ZoneDescriptor("AGT", -180, false), // as of 2011n
new ZoneDescriptor("BET", -180, true),
// new ZoneDescriptor("CAT", -60, false), // Wrong:
// As of bug 4130885, fix CAT (Central Africa)
@ -121,7 +121,7 @@ public class TimeZoneTest extends TestFmwk
new ZoneDescriptor("GMT", 0, false),
new ZoneDescriptor("UTC", 0, false),
new ZoneDescriptor("ECT", 60, true),
new ZoneDescriptor("ART", 120, true),
new ZoneDescriptor("ART", 120, false), // as of 2011n
new ZoneDescriptor("EET", 120, true),
new ZoneDescriptor("EAT", 180, false),
// new ZoneDescriptor("MET", 210, true),

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:103b8846e4e5221f288fe30e2cf9fb9bdd20fb03d5cb016de9693658e2aca8af
size 5062002
oid sha256:7fd099d3318296f86c8e2b02250d0e33ea3eb6134cc5afb4fd27c09f718394fa
size 5065814