summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDmitri Plotnikov <dplotnikov@google.com>2010-03-17 10:56:02 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-03-17 10:56:02 -0700
commitd8c208bab43c0a7f58389b87ec228d37409dc48b (patch)
treeb6abbc1c1e8801755e12e91feb368d8f00822977 /tests
parent09bc8d8c125ff0ba745b3d0ebf5b0236fa865deb (diff)
parent9ad006dd4532c5e6c91c9cb5f064354d0d44ea5f (diff)
downloadframeworks_base-d8c208bab43c0a7f58389b87ec228d37409dc48b.zip
frameworks_base-d8c208bab43c0a7f58389b87ec228d37409dc48b.tar.gz
frameworks_base-d8c208bab43c0a7f58389b87ec228d37409dc48b.tar.bz2
Merge "Disable the HanziToPinyinTest when there is no Chinese collator."
Diffstat (limited to 'tests')
-rw-r--r--tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java b/tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java
index 8e1ff0b..71a8ea7 100644
--- a/tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/internal/util/HanziToPinyinTest.java
@@ -17,6 +17,7 @@
package com.android.unit_tests.internal.util;
import java.text.Collator;
+import java.util.Arrays;
import java.util.ArrayList;
import java.util.Locale;
@@ -37,6 +38,9 @@ public class HanziToPinyinTest extends TestCase {
@SmallTest
public void testGetToken() throws Exception {
+ if (!Arrays.asList(Collator.getAvailableLocales()).contains(Locale.CHINA)) {
+ return;
+ }
ArrayList<Token> tokens = HanziToPinyin.getInstance().get(ONE_HANZI);
assertEquals(tokens.size(), 1);
assertEquals(tokens.get(0).type, Token.PINYIN);