diff options
author | Narayan Kamath <narayan@google.com> | 2014-07-22 12:44:14 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-07-23 10:40:57 +0100 |
commit | 2b6169d920f6b88a4d665713081b35e44a1d7532 (patch) | |
tree | 8680c70a8e1134066caa1199b7b94a6b58910fef /harmony-tests/src | |
parent | ac89b307fd132d44ac55b9109833730cbc2e86fc (diff) | |
download | libcore-2b6169d920f6b88a4d665713081b35e44a1d7532.zip libcore-2b6169d920f6b88a4d665713081b35e44a1d7532.tar.gz libcore-2b6169d920f6b88a4d665713081b35e44a1d7532.tar.bz2 |
Fix Collator tests.
Use the modern "es-u-co-trad" instead of "es-TRADITIONAL".
The latter is an invalid language tag (TRADITIONAL is an invalid
variant) so we will not support it any longer.
bug: 15849709
(cherry picked from commit ee7d0c5bfcc6891034eaea0fa4a9571ffde5d2ae)
Change-Id: I560837f07fa67cc556381e0644dd49e6c9fdc59c
Diffstat (limited to 'harmony-tests/src')
2 files changed, 10 insertions, 6 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/CollationElementIteratorTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/CollationElementIteratorTest.java index 0ca489c..081b446 100644 --- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/CollationElementIteratorTest.java +++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/CollationElementIteratorTest.java @@ -125,7 +125,8 @@ public class CollationElementIteratorTest extends TestCase { public void testGetMaxExpansion() { String text = "cha"; - RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance(new Locale("es", "", "TRADITIONAL")); + RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance( + Locale.forLanguageTag("es-u-co-trad")); CollationElementIterator iterator = rbColl.getCollationElementIterator(text); int order = iterator.next(); while (order != CollationElementIterator.NULLORDER) { @@ -177,7 +178,8 @@ public class CollationElementIteratorTest extends TestCase { } public void testSetOffset() { - RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance(new Locale("es", "", "TRADITIONAL")); + RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance( + Locale.forLanguageTag("es-u-co-trad")); String text = "cha"; CollationElementIterator iterator = rbColl.getCollationElementIterator(text); iterator.setOffset(0); @@ -189,7 +191,8 @@ public class CollationElementIteratorTest extends TestCase { } public void testSetTextString() { - RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance(new Locale("es", "", "TRADITIONAL")); + RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance( + Locale.forLanguageTag("es-u-co-trad")); String text = "caa"; CollationElementIterator iterator = rbColl.getCollationElementIterator(text); iterator.setOffset(0); @@ -208,7 +211,8 @@ public class CollationElementIteratorTest extends TestCase { } public void testSetTextCharacterIterator() { - RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance(new Locale("es", "", "TRADITIONAL")); + RuleBasedCollator rbColl = (RuleBasedCollator) Collator.getInstance( + Locale.forLanguageTag("es-u-co-trad")); String text = "caa"; CollationElementIterator iterator = rbColl.getCollationElementIterator(text); iterator.setOffset(1); diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java index f5a8057..906857b 100644 --- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java +++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java @@ -105,7 +105,7 @@ public class RuleBasedCollatorTest extends TestCase { public void testGetCollationElementIteratorString() throws Exception { { - Locale locale = new Locale("es", "", "TRADITIONAL"); + Locale locale = Locale.forLanguageTag("es-u-co-trad"); RuleBasedCollator coll = (RuleBasedCollator) Collator.getInstance(locale); String source = "cha"; CollationElementIterator iterator = coll.getCollationElementIterator(source); @@ -147,7 +147,7 @@ public class RuleBasedCollatorTest extends TestCase { public void testGetCollationElementIteratorCharacterIterator() throws Exception { { - Locale locale = new Locale("es", "", "TRADITIONAL"); + Locale locale = Locale.forLanguageTag("es-u-co-trad"); RuleBasedCollator coll = (RuleBasedCollator) Collator.getInstance(locale); String text = "cha"; StringCharacterIterator source = new StringCharacterIterator(text); |