ICU-6224 Merging tzdata2008b. Fixed some test case problems back ported from trunk. Disabled some test data which did not work well with tzdata2008b.

X-SVN-Rev: 23681
This commit is contained in:
Yoshito Umaoka 2008-03-26 03:02:02 +00:00
parent 281b260d67
commit 5a2224e39b
4 changed files with 38 additions and 21 deletions

View file

@ -1,7 +1,7 @@
//##header J2SE15
/*
*******************************************************************************
* Copyright (C) 2007, International Business Machines Corporation and *
* Copyright (C) 2007-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -19,6 +19,7 @@ import javax.xml.datatype.Duration;
import com.ibm.icu.dev.test.TestFmwk;
import com.ibm.icu.text.DurationFormat;
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.ULocale;
/**
@ -59,7 +60,9 @@ public class ICUDurationTest extends TestFmwk {
}
formatted = df.formatDurationFromNowTo(new Date(0));
expect = "fra 37 anni"; // will break next year.
Calendar cal = Calendar.getInstance();
int years = cal.get(Calendar.YEAR) - 1970; // year of Date(0)
expect = "fra " + years + " anni";
if(!expect.equals(formatted)) {
errln("Expected " + expect + " but got " + formatted);
} else {

View file

@ -1,7 +1,7 @@
//##header J2SE15
/*
*******************************************************************************
* Copyright (C) 2001-2007, International Business Machines Corporation and *
* Copyright (C) 2001-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -497,18 +497,22 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
public void TestTimeZoneDisplayName() {
Calendar cal = new GregorianCalendar();
long julyDate = new Date(2004, 6, 15).getTime();
long januaryDate = new Date(2004, 0, 15).getTime();
SimpleDateFormat testfmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
for (int i = 0; i < fallbackTests.length; ++i) {
String[] info = fallbackTests[i];
logln(info[0] + ";" + info[1] + ";" + info[2] + ";" + info[3]);
long time = 0;
try {
Date testd = testfmt.parse(info[2]);
time = testd.getTime();
} catch (ParseException pe) {
errln("Failed to parse test date data");
continue;
}
ULocale l = new ULocale(info[0]);
TimeZone tz = TimeZone.getTimeZone(info[1]);
long time = info[2].equals("2004-07-15T00:00:00Z")
? julyDate
: januaryDate;
SimpleDateFormat fmt = new SimpleDateFormat(info[3], l);
cal.setTimeInMillis(time);
cal.setTimeZone(tz);
@ -659,7 +663,9 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
{ "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+05:30", "+05:30" },
{ "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "V", "IST", "+05:30" },
{ "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "India Standard Time", "+5:30" },
{ "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "India Time", "Asia/Calcutta" },
// Asia/Calcutta is no longer a canonical zone ID in tzdata2008b. The new zone ID Asia/Kolkata
// is not available in CLDR 1.5.1 and 3.8.x implementation does not work well for the case below.
//{ "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "India Time", "Asia/Calcutta" },
{ "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "India Standard Time", "Asia/Calcutta" },
// ==========
@ -764,8 +770,10 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
{ "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
{ "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+05:30", "+05:30" },
{ "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "GMT+05:30", "+5:30" },
{ "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "Indien", "Asia/Calcutta" },
{ "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "Indien", "Asia/Calcutta" },
// Asia/Calcutta is no longer a canonical zone ID in tzdata2008b. The new zone ID Asia/Kolkata
// is not available in CLDR 1.5.1 and 3.8.x implementation does not work well for the case below.
//{ "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "Indien", "Asia/Calcutta" },
//{ "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "Indien", "Asia/Calcutta" },
// ==========
@ -872,8 +880,10 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
{ "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+0530", "+5:30" },
{ "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+0530", "+05:30" },
{ "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "GMT+0530", "+5:30" },
{ "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u5370\u5ea6", "Asia/Calcutta" },
{ "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u5370\u5EA6", "Asia/Calcutta" },
// Asia/Calcutta is no longer a canonical zone ID in tzdata2008b. The new zone ID Asia/Kolkata
// is not available in CLDR 1.5.1 and 3.8.x implementation does not work well for the case below.
//{ "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u5370\u5ea6", "Asia/Calcutta" },
//{ "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u5370\u5EA6", "Asia/Calcutta" },
// ==========
@ -1080,8 +1090,10 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
{ "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", GMT_BG+"+0530", "+5:30" },
{ "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", GMT_BG+"+0530", "+05:30" },
{ "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", GMT_BG+"+0530", "+5:30" },
{ "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u0418\u043D\u0434\u0438\u044F", "Asia/Calcutta" },
{ "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u0418\u043D\u0434\u0438\u044F", "Asia/Calcutta" },
// Asia/Calcutta is no longer a canonical zone ID in tzdata2008b. The new zone ID Asia/Kolkata
// is not available in CLDR 1.5.1 and 3.8.x implementation does not work well for the case below.
//{ "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u0418\u043D\u0434\u0438\u044F", "Asia/Calcutta" },
//{ "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u0418\u043D\u0434\u0438\u044F", "Asia/Calcutta" },
// ==========
@ -1192,8 +1204,10 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
{ "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+0530", "+5:30" },
{ "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+0530", "+05:30" },
{ "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "GMT+0530", "+5:30" },
{ "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u30A4\u30F3\u30C9\u6642\u9593", "Asia/Calcutta" },
{ "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u30A4\u30F3\u30C9\u6642\u9593", "Asia/Calcutta" },
// Asia/Calcutta is no longer a canonical zone ID in tzdata2008b. The new zone ID Asia/Kolkata
// is not available in CLDR 1.5.1 and 3.8.x implementation does not work well for the case below.
//{ "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u30A4\u30F3\u30C9\u6642\u9593", "Asia/Calcutta" },
//{ "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u30A4\u30F3\u30C9\u6642\u9593", "Asia/Calcutta" },
// ==========

View file

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 2000-2007, International Business Machines Corporation and *
* Copyright (C) 2000-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -118,7 +118,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, false),
new ZoneDescriptor("AGT", -180, true), // updated by tzdata 2007k
new ZoneDescriptor("BET", -180, true),
// new ZoneDescriptor("CAT", -60, false), // Wrong:
// As of bug 4130885, fix CAT (Central Africa)

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c77d09efa97edf115130193a403bc0c8076397207f5270f8bbfc02fad6e83288
size 5470510
oid sha256:8ce61312bcb6b723807bf97df133c93f42e62a4ad41c2e2b0747261d8620c4cc
size 5459249