diff options
author | Fredrik Roubert <roubert@google.com> | 2015-03-03 18:14:45 +0100 |
---|---|---|
committer | Nikita Iashchenko <nikitai@google.com> | 2019-12-19 14:52:21 +0000 |
commit | 55903cb71cee02351788414572fda968006747f3 (patch) | |
tree | 54835e3368e90d76a0ae2bcbd09ef34d3dc5ab16 /icu4j/main/tests | |
parent | 023c06d9eb52933c45c393dde50af0cd5d62c4cb (diff) | |
download | icu-55903cb71cee02351788414572fda968006747f3.tar.gz |
Android patch: CLDR data: Force default Gregorian calendar.
This change was introduced in Android by this patch:
https://android.googlesource.com/platform/external/icu/+/b844b3e
And then amended by the ICU 52 upgrade:
https://android.googlesource.com/platform/external/icu/+/59d709d
And then amended for ICU 55:
https://android.googlesource.com/platform/external/icu/+/fafa8ad
And then amended for ICU 58:
https://android.googlesource.com/platform/external/icu/+/047edd2
And then amended for ICU 64, updating test expectaiotns for
DateIntervalFormatTest and removing obsolete th_TH_TRADIOTIONAL locale
from IBMCalendarTest since it is now equivalent to th_TH.
Test: n/a
Change-Id: I3f16825a16cc90857106ebec1138ffc2bb154715
Diffstat (limited to 'icu4j/main/tests')
4 files changed, 54 insertions, 37 deletions
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CalendarRegressionTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CalendarRegressionTest.java index 8f73d1621..134d170c1 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CalendarRegressionTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CalendarRegressionTest.java @@ -2150,32 +2150,36 @@ public class CalendarRegressionTest extends com.ibm.icu.dev.test.TestFmwk { Locale loc = new Locale("en", "TH"); Calendar cal = Calendar.getInstance(loc); String calType = cal.getType(); - if ( !calType.equals("buddhist")) { - errln("FAIL: Calendar type for en_TH should still be buddhist"); + // Android patch: Force default Gregorian calendar. + if ( !calType.equals("gregorian")) { + errln("FAIL: Calendar type for en_TH should still be gregorian"); } + // Android patch end. } @Test public void TestGetKeywordValuesForLocale(){ + // Android patch: Force default Gregorian calendar. final String[][] PREFERRED = { {"root", "gregorian"}, {"und", "gregorian"}, {"en_US", "gregorian"}, {"en_029", "gregorian"}, - {"th_TH", "buddhist", "gregorian"}, - {"und_TH", "buddhist", "gregorian"}, - {"en_TH", "buddhist", "gregorian"}, + {"th_TH", "gregorian", "buddhist"}, + {"und_TH", "gregorian", "buddhist"}, + {"en_TH", "gregorian", "buddhist"}, {"he_IL", "gregorian", "hebrew", "islamic", "islamic-civil", "islamic-tbla"}, {"ar_EG", "gregorian", "coptic", "islamic", "islamic-civil", "islamic-tbla"}, {"ja", "gregorian", "japanese"}, {"ps_Guru_IN", "gregorian", "indian"}, - {"th@calendar=gregorian", "buddhist", "gregorian"}, + {"th@calendar=gregorian", "gregorian", "buddhist"}, {"en@calendar=islamic", "gregorian"}, {"zh_TW", "gregorian", "roc", "chinese"}, - {"ar_IR", "persian", "gregorian", "islamic", "islamic-civil", "islamic-tbla"}, - {"th@rg=SAZZZZ", "islamic-umalqura", "gregorian", "islamic", "islamic-rgsa"}, + {"ar_IR", "gregorian", "persian", "islamic", "islamic-civil", "islamic-tbla"}, + {"th@rg=SAZZZZ", "gregorian", "islamic-umalqura", "islamic", "islamic-rgsa"}, }; + // Android patch end. String[] ALL = Calendar.getKeywordValuesForLocale("calendar", ULocale.getDefault(), false); HashSet ALLSET = new HashSet(); diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java index 03e6a0c74..306a3f864 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java @@ -332,9 +332,11 @@ public class IBMCalendarTest extends CalendarTestFmwk { // Thai locale Calendar cal = Calendar.getInstance(new ULocale("th_TH")); String type = cal.getType(); - if (!type.equals("buddhist")) { - errln("FAIL: Buddhist calendar is not returned for locale " + cal.toString()); + // Android patch: Force default Gregorian calendar. + if (!type.equals("gregorian")) { + errln("FAIL: Gregorian calendar is not returned for locale " + cal.toString()); } + // Android patch end. } /** @@ -1101,6 +1103,7 @@ public class IBMCalendarTest extends CalendarTestFmwk { "th@rg=SA", // ignore malformed rg tag, use buddhist }; + // Android patch: Force default Gregorian calendar. String[] types = { "gregorian", "japanese", @@ -1108,20 +1111,21 @@ public class IBMCalendarTest extends CalendarTestFmwk { "japanese", "buddhist", "gregorian", - "buddhist", "gregorian", "gregorian", - "buddhist", - "buddhist", - "buddhist", + "gregorian", + "gregorian", + "gregorian", + "gregorian", "gregorian", // iso8601 is a gregorian sub type "gregorian", - "islamic-umalqura", - "islamic-umalqura", + "gregorian", + "gregorian", "japanese", - "buddhist", - "buddhist", + "gregorian", + "gregorian", }; + // Android patch end. for (int i = 0; i < locs.length; i++) { Calendar cal = Calendar.getInstance(new ULocale(locs[i])); diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java index 5805b03ef..345326867 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java @@ -649,48 +649,54 @@ public class DateIntervalFormatTest extends TestFmwk { // Thai (default calendar buddhist) - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2550 \\u2013 \\u0E27\\u0E31\\u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2551", + // Android patch: Force default Gregorian calendar. + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2550 \\u2013 \\u0E27\\u0E31\\u0E19\\u0E2D\\u0E32\\u0E17\\u0E34\\u0E15\\u0E22\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. 2550 \\u2013 10 \\u0E15.\\u0E04. 2551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u0E04. 2550 \\u2013 \\u0E15.\\u0E04. 2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. 2550 \\u2013 10 \\u0E15.\\u0E04. 2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u0E04. 2550 \\u2013 \\u0E15.\\u0E04. 2551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "dMy", "10/10/2550 \\u2013 10/10/2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "ส. 10/10/2550 – อา. 10/10/2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMy", "10/10/2550 \\u2013 10/10/2551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "My", "10/2550 \\u2013 10/2551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "\\u0E2A. 10/10/2550 \\u2013 \\u0E2D\\u0E32. 10/10/2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "My", "10/2550 \\u2013 10/2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "ส. 10/10/2550 – อา. 10/10/2551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "y", "2550\\u20132551", - "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "M", "10/2550 \\u2013 10/2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "y", "2550\\u20132551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "\\u0E2A. 10/10/2550 \\u2013 \\u0E2D\\u0E32. 10/10/2551", + "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "M", "10/2550 \\u2013 10/2551", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. \\u2013 \\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E1E.\\u0E22. 2550", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "วันเสาร์ที่ 10 ต.ค. – วันอังคารที่ 10 พ.ย. 2550", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. \\u2013 10 \\u0E1E.\\u0E22.", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22. 2550", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. \\u2013 10 \\u0E1E.\\u0E22.", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "dM", "10/10 \\u2013 10/11", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. \\u2013 \\u0E27\\u0E31\\u0E19\\u0E2D\\u0E31\\u0E07\\u0E04\\u0E32\\u0E23\\u0E17\\u0E35\\u0E48 10 \\u0E1E.\\u0E22. 2550", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22. 2550", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "My", "10/2550 \\u2013 11/2550", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 \\u2013 10/11", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "My", "10/2550 \\u2013 11/2550", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "d", "10/10 \\u2013 10/11", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "y", "\u0E1E.\u0E28. 2550", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "d", "10/10 \\u2013 10/11", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "2550", - "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "MMM", "\u0E15.\u0E04.\u2013\u0E1E.\u0E22.", + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "ต.ค. – พ.ย.", + + "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "2550", // Tests for Japanese calendar with eras, including new era in 2019 (Heisei 31 through April 30, then new era) "en-u-ca-japanese", "H 31 03 15 09:00:00", "H 31 04 15 09:00:00", "GyMMMd", "Mar 15 \u2013 Apr 15, 31 Heisei", @@ -716,6 +722,7 @@ public class DateIntervalFormatTest extends TestFmwk { "ja-u-ca-japanese", "H 31 04 15 09:00:00", DateFormat.JP_ERA_2019_NARROW+" 1 05 15 09:00:00", "GGGGGyMd", "H31/04/15\uFF5E"+DateFormat.JP_ERA_2019_NARROW+"1/05/15", + // Android patch end. }; expect(DATA, DATA.length); } diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java index 28f77b7dc..6294f0ec2 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java @@ -754,6 +754,7 @@ public final class ICUResourceBundleTest extends TestFmwk { @Test public void TestFunctionalEquivalent(){ + // Android patch: Force default Gregorian calendar. String[] calCases = { // avail locale equiv "t", "en_US_POSIX", "en@calendar=gregorian", @@ -761,10 +762,11 @@ public final class ICUResourceBundleTest extends TestFmwk { "f", "ja_JP_TOKYO@calendar=japanese", "ja@calendar=japanese", "t", "sr@calendar=gregorian", "sr@calendar=gregorian", "t", "en", "en@calendar=gregorian", - "t", "th_TH", "th@calendar=buddhist", + "t", "th_TH", "th@calendar=gregorian", "t", "th_TH@calendar=gregorian", "th@calendar=gregorian", - "f", "th_TH_Bangkok", "th@calendar=buddhist", + "f", "th_TH_Bangkok", "th@calendar=gregorian", }; + // Android patch end. logln("Testing functional equivalents for calendar..."); getFunctionalEquivalentTestCases(ICUData.ICU_BASE_NAME, |