summaryrefslogtreecommitdiff
path: root/icu4j/main/tests
diff options
context:
space:
mode:
authorNikita Iashchenko <nikitai@google.com>2019-07-18 17:54:23 +0100
committerNikita Iashchenko <nikitai@google.com>2019-07-24 19:51:10 +0100
commitf2b03fe66b58f6ed2af818c4805f27785e05ac46 (patch)
treef540373a99c98b6dc459569c7f618cd231524ed7 /icu4j/main/tests
parent57550c5fe28ccafb077fe941aa95e207059b7328 (diff)
downloadicu-f2b03fe66b58f6ed2af818c4805f27785e05ac46.tar.gz
Cherry-pick: ICU-12431 Update test expectations in TestLocaleNamePackaging
Upstream commit: https://github.com/unicode-org/icu/commit/78a4abc5ed5db9ddadb57dca0f5222e7639c124c These test expectations have been out-of-sync with the output that ICU4J actually generates for quite some time now. This change brings the expectations in sync with actual behaviour and makes the test pass. Test: n/a Change-Id: I9a1e1476ba709a5249d0131750f9dac539e33f5c
Diffstat (limited to 'icu4j/main/tests')
-rw-r--r--icu4j/main/tests/packaging/src/com/ibm/icu/dev/test/TestLocaleNamePackaging.java48
1 files changed, 26 insertions, 22 deletions
diff --git a/icu4j/main/tests/packaging/src/com/ibm/icu/dev/test/TestLocaleNamePackaging.java b/icu4j/main/tests/packaging/src/com/ibm/icu/dev/test/TestLocaleNamePackaging.java
index e062b7243..1c99ac2de 100644
--- a/icu4j/main/tests/packaging/src/com/ibm/icu/dev/test/TestLocaleNamePackaging.java
+++ b/icu4j/main/tests/packaging/src/com/ibm/icu/dev/test/TestLocaleNamePackaging.java
@@ -68,10 +68,10 @@ public class TestLocaleNamePackaging extends TestFmwk {
"Deutschland",
"Thailand",
"",
- "United States",
- "Spain",
- "Germany",
- "Thailand",
+ "US",
+ "ES",
+ "DE",
+ "TH",
};
String[] expectedWithoutRegionData = {
"",
@@ -117,34 +117,35 @@ public class TestLocaleNamePackaging extends TestFmwk {
"en",
"es",
"de",
- "und",
+ "",
"",
"English",
"Spanish",
"German",
- "Unknown Language",
+ "",
"",
"ingl\u00E9s",
"espa\u00F1ol",
"alem\u00E1n",
- "lengua desconocida",
+ "",
"",
"Englisch",
"Spanisch",
"Deutsch",
- "Unbestimmte Sprache",
"",
- "English",
- "Spanish",
- "German",
- "Unknown Language",
+ "",
+ "en",
+ "es",
+ "de",
+ "",
+
};
String[] expectedWithoutLanguageData = {
"",
"en",
"es",
"de",
- "und"
+ ""
};
String[] expected = LocaleDisplayNamesImpl.haveData(LANG) ?
expectedWithLanguageData : expectedWithoutLanguageData;
@@ -166,9 +167,12 @@ public class TestLocaleNamePackaging extends TestFmwk {
for (Locale displayJavaLocale : javaLocales) {
LocaleDisplayNames dn = LocaleDisplayNames.getInstance(displayJavaLocale);
for (Locale targetLocale : javaLocales) {
- String result = dn.languageDisplayName(targetLocale.getLanguage());
- assertEquals(targetLocale + " in " + displayJavaLocale, expected[n++], result);
- if (n == expected.length) {
+ // ICU-20273: ICU and Java handle "und" differently, skip those test cases.
+ if (!"und".equals(targetLocale.getLanguage())) {
+ String result = dn.languageDisplayName(targetLocale.getLanguage());
+ assertEquals(targetLocale + " in " + displayJavaLocale, expected[n], result);
+ }
+ if (++n == expected.length) {
n = 0;
}
}
@@ -180,14 +184,14 @@ public class TestLocaleNamePackaging extends TestFmwk {
@Test
public void testLocaleDisplayNameWithKeywords() {
String[] expectedWithLanguageData = {
- "root (collation=phonebook)",
- "Root (Phonebook Sort Order)",
- "ra\u00EDz (orden de list\u00EDn telef\u00F3nico)",
- "Root (Telefonbuch-Sortierung)",
- "Root (Phonebook Sort Order)",
+ "und (collation=phonebook)",
+ "Unknown language (Phonebook Sort Order)",
+ "lengua desconocida (orden de list\u00EDn telef\u00F3nico)",
+ "Unbekannte Sprache (Telefonbuch-Sortierung)",
+ "und (collation=phonebook)",
};
String[] expectedWithoutLanguageData = {
- "root (collation=phonebook)",
+ "und (collation=phonebook)",
};
String[] expected = LocaleDisplayNamesImpl.haveData(LANG) ?
expectedWithLanguageData : expectedWithoutLanguageData;