diff options
Diffstat (limited to 'tests/src')
5 files changed, 17 insertions, 19 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java index cbe2d5960..7b7f1758c 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java @@ -92,7 +92,7 @@ public class KeySpecParserSplitTests extends InstrumentationTestCase { private void assertTextArray(final String message, final String value, final String ... expectedArray) { - final String resolvedActual = KeySpecParser.resolveTextReference(value, mTextsSet); + final String resolvedActual = mTextsSet.resolveTextReference(value); final String[] actual = KeySpecParser.splitKeySpecs(resolvedActual); final String[] expected = (expectedArray.length == 0) ? null : expectedArray; assertArrayEquals(message, expected, actual); @@ -117,13 +117,11 @@ public class KeySpecParserSplitTests extends InstrumentationTestCase { private static final String SURROGATE2 = PAIR1 + PAIR2 + PAIR3; public void testResolveNullText() { - assertNull("resolve null", KeySpecParser.resolveTextReference( - null, mTextsSet)); + assertNull("resolve null", mTextsSet.resolveTextReference(null)); } public void testResolveEmptyText() { - assertNull("resolve empty text", KeySpecParser.resolveTextReference( - "!text/empty_string", mTextsSet)); + assertNull("resolve empty text", mTextsSet.resolveTextReference("!text/empty_string")); } public void testSplitZero() { diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java index afb2b0343..0388435eb 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java @@ -73,7 +73,7 @@ public class KeySpecParserTests extends AndroidTestCase { private void assertParser(String message, String moreKeySpec, String expectedLabel, String expectedOutputText, int expectedIcon, int expectedCode) { - final String labelResolved = KeySpecParser.resolveTextReference(moreKeySpec, mTextsSet); + final String labelResolved = mTextsSet.resolveTextReference(moreKeySpec); final MoreKeySpec spec = new MoreKeySpec(labelResolved, false /* needsToUpperCase */, Locale.US, mCodesSet); assertEquals(message + " [label]", expectedLabel, spec.mLabel); diff --git a/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java b/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java index c42765633..343ab420c 100644 --- a/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java +++ b/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java @@ -102,13 +102,13 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { getContext().getCacheDir()); FileUtils.deleteRecursively(file); Map<String, String> attributeMap = new HashMap<String, String>(); - attributeMap.put(FormatSpec.FileHeader.DICTIONARY_ID_ATTRIBUTE, dictId); - attributeMap.put(FormatSpec.FileHeader.DICTIONARY_LOCALE_ATTRIBUTE, dictId); - attributeMap.put(FormatSpec.FileHeader.DICTIONARY_VERSION_ATTRIBUTE, + attributeMap.put(FormatSpec.FileHeader.DICTIONARY_ID_KEY, dictId); + attributeMap.put(FormatSpec.FileHeader.DICTIONARY_LOCALE_KEY, dictId); + attributeMap.put(FormatSpec.FileHeader.DICTIONARY_VERSION_KEY, String.valueOf(TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()))); - attributeMap.put(FormatSpec.FileHeader.USES_FORGETTING_CURVE_ATTRIBUTE, + attributeMap.put(FormatSpec.FileHeader.USES_FORGETTING_CURVE_KEY, FormatSpec.FileHeader.ATTRIBUTE_VALUE_TRUE); - attributeMap.put(FormatSpec.FileHeader.HAS_HISTORICAL_INFO_ATTRIBUTE, + attributeMap.put(FormatSpec.FileHeader.HAS_HISTORICAL_INFO_KEY, FormatSpec.FileHeader.ATTRIBUTE_VALUE_TRUE); if (BinaryDictionary.createEmptyDictFile(file.getAbsolutePath(), FormatSpec.VERSION4, attributeMap)) { diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java index f17596865..20cf9a562 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java @@ -39,13 +39,13 @@ public class BinaryDictUtils { public static DictionaryOptions makeDictionaryOptions(final String id, final String version, final FormatSpec.FormatOptions formatOptions) { final DictionaryOptions options = new DictionaryOptions(new HashMap<String, String>()); - options.mAttributes.put(FileHeader.DICTIONARY_LOCALE_ATTRIBUTE, "en_US"); - options.mAttributes.put(FileHeader.DICTIONARY_ID_ATTRIBUTE, id); - options.mAttributes.put(FileHeader.DICTIONARY_VERSION_ATTRIBUTE, version); + options.mAttributes.put(FileHeader.DICTIONARY_LOCALE_KEY, "en_US"); + options.mAttributes.put(FileHeader.DICTIONARY_ID_KEY, id); + options.mAttributes.put(FileHeader.DICTIONARY_VERSION_KEY, version); if (formatOptions.mHasTimestamp) { - options.mAttributes.put(FileHeader.HAS_HISTORICAL_INFO_ATTRIBUTE, + options.mAttributes.put(FileHeader.HAS_HISTORICAL_INFO_KEY, FileHeader.ATTRIBUTE_VALUE_TRUE); - options.mAttributes.put(FileHeader.USES_FORGETTING_CURVE_ATTRIBUTE, + options.mAttributes.put(FileHeader.USES_FORGETTING_CURVE_KEY, FileHeader.ATTRIBUTE_VALUE_TRUE); } return options; diff --git a/tests/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtilsTests.java index ae08b49d7..93731b3cd 100644 --- a/tests/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtilsTests.java @@ -56,9 +56,9 @@ public class UserHistoryDictIOUtilsTests extends AndroidTestCase private static final String TEST_DICT_FILE_EXTENSION = ".testDict"; private static final HashMap<String, String> HEADER_OPTIONS = new HashMap<String, String>(); static { - HEADER_OPTIONS.put(FileHeader.DICTIONARY_LOCALE_ATTRIBUTE, "en_US"); - HEADER_OPTIONS.put(FileHeader.DICTIONARY_ID_ATTRIBUTE, "test"); - HEADER_OPTIONS.put(FileHeader.DICTIONARY_VERSION_ATTRIBUTE, "1000"); + HEADER_OPTIONS.put(FileHeader.DICTIONARY_LOCALE_KEY, "en_US"); + HEADER_OPTIONS.put(FileHeader.DICTIONARY_ID_KEY, "test"); + HEADER_OPTIONS.put(FileHeader.DICTIONARY_VERSION_KEY, "1000"); } /** |