2012-08-20 10:29:20 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2013-07-26 03:35:11 +00:00
|
|
|
package com.android.inputmethod.latin.personalization;
|
2012-08-20 10:29:20 +00:00
|
|
|
|
|
|
|
import android.test.AndroidTestCase;
|
2013-02-04 23:25:24 +00:00
|
|
|
import android.test.suitebuilder.annotation.LargeTest;
|
2012-08-20 10:29:20 +00:00
|
|
|
import android.util.Log;
|
|
|
|
|
2013-08-19 01:17:02 +00:00
|
|
|
import com.android.inputmethod.latin.ExpandableBinaryDictionary;
|
2014-05-21 02:15:38 +00:00
|
|
|
import com.android.inputmethod.latin.PrevWordsInfo;
|
2014-06-25 05:14:37 +00:00
|
|
|
import com.android.inputmethod.latin.PrevWordsInfo.WordInfo;
|
2014-03-05 09:19:34 +00:00
|
|
|
import com.android.inputmethod.latin.utils.BinaryDictionaryUtils;
|
2014-05-26 08:28:27 +00:00
|
|
|
import com.android.inputmethod.latin.utils.DistracterFilter;
|
2014-02-13 07:16:44 +00:00
|
|
|
import com.android.inputmethod.latin.utils.FileUtils;
|
2013-06-23 16:11:32 +00:00
|
|
|
|
2012-10-05 06:12:50 +00:00
|
|
|
import java.io.File;
|
2014-08-13 06:51:16 +00:00
|
|
|
import java.io.FilenameFilter;
|
2012-08-20 10:29:20 +00:00
|
|
|
import java.util.ArrayList;
|
2014-05-23 11:18:17 +00:00
|
|
|
import java.util.HashSet;
|
2012-08-20 10:29:20 +00:00
|
|
|
import java.util.List;
|
2013-12-13 08:09:16 +00:00
|
|
|
import java.util.Locale;
|
2012-08-20 10:29:20 +00:00
|
|
|
import java.util.Random;
|
2013-08-16 05:17:09 +00:00
|
|
|
import java.util.concurrent.TimeUnit;
|
2012-08-20 10:29:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unit tests for UserHistoryDictionary
|
|
|
|
*/
|
2013-02-04 23:25:24 +00:00
|
|
|
@LargeTest
|
2012-08-20 10:29:20 +00:00
|
|
|
public class UserHistoryDictionaryTests extends AndroidTestCase {
|
|
|
|
private static final String TAG = UserHistoryDictionaryTests.class.getSimpleName();
|
2014-08-12 13:29:02 +00:00
|
|
|
private static final int WAIT_FOR_WRITING_FILE_IN_MILLISECONDS = 3000;
|
2014-08-13 06:51:16 +00:00
|
|
|
private static final String TEST_LOCALE_PREFIX = "test_";
|
2012-08-20 10:29:20 +00:00
|
|
|
|
|
|
|
private static final String[] CHARACTERS = {
|
|
|
|
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
|
|
|
|
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
|
|
|
|
};
|
|
|
|
|
2014-02-20 09:36:46 +00:00
|
|
|
private int mCurrentTime = 0;
|
|
|
|
|
2014-08-13 06:51:16 +00:00
|
|
|
private void removeAllTestDictFiles() {
|
|
|
|
final Locale dummyLocale = new Locale(TEST_LOCALE_PREFIX);
|
|
|
|
final String dictName = ExpandableBinaryDictionary.getDictName(
|
|
|
|
UserHistoryDictionary.NAME, dummyLocale, null /* dictFile */);
|
|
|
|
final File dictFile = ExpandableBinaryDictionary.getDictFile(
|
|
|
|
mContext, dictName, null /* dictFile */);
|
|
|
|
final FilenameFilter filenameFilter = new FilenameFilter() {
|
|
|
|
@Override
|
|
|
|
public boolean accept(File dir, String filename) {
|
|
|
|
return filename.startsWith(UserHistoryDictionary.NAME + "." + TEST_LOCALE_PREFIX);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
FileUtils.deleteFilteredFiles(dictFile.getParentFile(), filenameFilter);
|
|
|
|
}
|
|
|
|
|
2014-08-13 06:51:34 +00:00
|
|
|
private void printAllFiles(final File dir) {
|
|
|
|
Log.d(TAG, dir.getAbsolutePath());
|
|
|
|
for (final File file : dir.listFiles()) {
|
|
|
|
Log.d(TAG, " " + file.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-20 09:36:46 +00:00
|
|
|
@Override
|
|
|
|
protected void setUp() throws Exception {
|
|
|
|
super.setUp();
|
2014-02-20 12:23:57 +00:00
|
|
|
resetCurrentTimeForTestMode();
|
2014-08-13 06:51:16 +00:00
|
|
|
removeAllTestDictFiles();
|
2014-02-20 09:36:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void tearDown() throws Exception {
|
2014-08-13 06:51:16 +00:00
|
|
|
removeAllTestDictFiles();
|
2014-02-20 09:36:46 +00:00
|
|
|
stopTestModeInNativeCode();
|
|
|
|
super.tearDown();
|
|
|
|
}
|
|
|
|
|
2014-02-20 12:23:57 +00:00
|
|
|
private void resetCurrentTimeForTestMode() {
|
|
|
|
mCurrentTime = 0;
|
|
|
|
setCurrentTimeForTestMode(mCurrentTime);
|
|
|
|
}
|
|
|
|
|
2014-02-20 09:36:46 +00:00
|
|
|
private void forcePassingShortTime() {
|
2014-02-20 12:23:57 +00:00
|
|
|
// 3 days.
|
|
|
|
final int timeToElapse = (int)TimeUnit.DAYS.toSeconds(3);
|
2014-02-20 09:36:46 +00:00
|
|
|
mCurrentTime += timeToElapse;
|
|
|
|
setCurrentTimeForTestMode(mCurrentTime);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void forcePassingLongTime() {
|
2014-03-14 03:23:24 +00:00
|
|
|
// 365 days.
|
|
|
|
final int timeToElapse = (int)TimeUnit.DAYS.toSeconds(365);
|
2014-02-20 09:36:46 +00:00
|
|
|
mCurrentTime += timeToElapse;
|
|
|
|
setCurrentTimeForTestMode(mCurrentTime);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static int setCurrentTimeForTestMode(final int currentTime) {
|
2014-03-05 09:19:34 +00:00
|
|
|
return BinaryDictionaryUtils.setCurrentTimeForTest(currentTime);
|
2014-02-20 09:36:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private static int stopTestModeInNativeCode() {
|
2014-03-05 09:19:34 +00:00
|
|
|
return BinaryDictionaryUtils.setCurrentTimeForTest(-1);
|
2014-02-20 09:36:46 +00:00
|
|
|
}
|
|
|
|
|
2012-08-20 10:29:20 +00:00
|
|
|
/**
|
|
|
|
* Generates a random word.
|
|
|
|
*/
|
2014-02-13 07:16:44 +00:00
|
|
|
private static String generateWord(final int value) {
|
2012-08-20 10:29:20 +00:00
|
|
|
final int lengthOfChars = CHARACTERS.length;
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
long lvalue = Math.abs((long)value);
|
|
|
|
while (lvalue > 0) {
|
|
|
|
builder.append(CHARACTERS[(int)(lvalue % lengthOfChars)]);
|
|
|
|
lvalue /= lengthOfChars;
|
|
|
|
}
|
|
|
|
return builder.toString();
|
|
|
|
}
|
|
|
|
|
2014-02-13 07:16:44 +00:00
|
|
|
private static List<String> generateWords(final int number, final Random random) {
|
2014-05-23 11:18:17 +00:00
|
|
|
final HashSet<String> wordSet = new HashSet<>();
|
2012-08-20 10:29:20 +00:00
|
|
|
while (wordSet.size() < number) {
|
|
|
|
wordSet.add(generateWord(random.nextInt()));
|
|
|
|
}
|
2014-05-23 11:18:17 +00:00
|
|
|
return new ArrayList<>(wordSet);
|
2012-08-20 10:29:20 +00:00
|
|
|
}
|
|
|
|
|
2014-02-13 07:16:44 +00:00
|
|
|
private static void addToDict(final UserHistoryDictionary dict, final List<String> words) {
|
2014-05-23 14:19:33 +00:00
|
|
|
PrevWordsInfo prevWordsInfo = PrevWordsInfo.EMPTY_PREV_WORDS_INFO;
|
2012-08-20 10:29:20 +00:00
|
|
|
for (String word : words) {
|
2014-05-21 02:15:38 +00:00
|
|
|
UserHistoryDictionary.addToDictionary(dict, prevWordsInfo, word, true,
|
2014-05-26 08:28:27 +00:00
|
|
|
(int)TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),
|
|
|
|
DistracterFilter.EMPTY_DISTRACTER_FILTER);
|
2014-06-25 05:14:37 +00:00
|
|
|
prevWordsInfo = prevWordsInfo.getNextPrevWordsInfo(new WordInfo(word));
|
2012-08-20 10:29:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-06 13:12:52 +00:00
|
|
|
/**
|
2013-09-27 02:13:22 +00:00
|
|
|
* @param checkContents if true, checks whether written words are actually in the dictionary
|
2013-09-06 13:12:52 +00:00
|
|
|
* or not.
|
|
|
|
*/
|
2014-02-13 07:16:44 +00:00
|
|
|
private void addAndWriteRandomWords(final Locale locale, final int numberOfWords,
|
2013-09-27 02:13:22 +00:00
|
|
|
final Random random, final boolean checkContents) {
|
2013-08-16 05:17:09 +00:00
|
|
|
final List<String> words = generateWords(numberOfWords, random);
|
2014-02-13 07:16:44 +00:00
|
|
|
final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(
|
|
|
|
mContext, locale);
|
2013-08-16 05:17:09 +00:00
|
|
|
// Add random words to the user history dictionary.
|
|
|
|
addToDict(dict, words);
|
2013-09-27 02:13:22 +00:00
|
|
|
if (checkContents) {
|
2013-12-13 08:09:16 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2013-09-27 02:13:22 +00:00
|
|
|
for (int i = 0; i < numberOfWords; ++i) {
|
2013-09-06 13:12:52 +00:00
|
|
|
final String word = words.get(i);
|
2014-06-09 02:04:28 +00:00
|
|
|
assertTrue(dict.isInDictionary(word));
|
2013-09-06 13:12:52 +00:00
|
|
|
}
|
|
|
|
}
|
2013-08-16 05:17:09 +00:00
|
|
|
// write to file.
|
|
|
|
dict.close();
|
|
|
|
}
|
|
|
|
|
2013-10-03 11:55:34 +00:00
|
|
|
/**
|
|
|
|
* Clear all entries in the user history dictionary.
|
2014-02-13 07:16:44 +00:00
|
|
|
* @param locale dummy locale for testing.
|
2013-10-03 11:55:34 +00:00
|
|
|
*/
|
2014-02-13 07:16:44 +00:00
|
|
|
private void clearHistory(final Locale locale) {
|
|
|
|
final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(
|
|
|
|
mContext, locale);
|
2014-01-15 02:18:39 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2014-04-24 18:25:47 +00:00
|
|
|
dict.clear();
|
2013-10-03 11:55:34 +00:00
|
|
|
dict.close();
|
2014-01-15 02:18:39 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2013-10-03 11:55:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shut down executer and wait until all operations of user history are done.
|
2014-02-13 07:16:44 +00:00
|
|
|
* @param locale dummy locale for testing.
|
2013-10-03 11:55:34 +00:00
|
|
|
*/
|
2014-02-13 07:16:44 +00:00
|
|
|
private void waitForWriting(final Locale locale) {
|
|
|
|
final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(
|
|
|
|
mContext, locale);
|
2013-12-13 08:09:16 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2013-10-03 11:55:34 +00:00
|
|
|
}
|
|
|
|
|
2012-08-20 10:29:20 +00:00
|
|
|
public void testRandomWords() {
|
2013-08-16 05:17:09 +00:00
|
|
|
Log.d(TAG, "This test can be used for profiling.");
|
|
|
|
Log.d(TAG, "Usage: please set UserHistoryDictionary.PROFILE_SAVE_RESTORE to true.");
|
2014-08-13 06:51:16 +00:00
|
|
|
final Locale dummyLocale =
|
|
|
|
new Locale(TEST_LOCALE_PREFIX + "random_words" + System.currentTimeMillis());
|
2014-02-13 07:16:44 +00:00
|
|
|
final String dictName = ExpandableBinaryDictionary.getDictName(
|
|
|
|
UserHistoryDictionary.NAME, dummyLocale, null /* dictFile */);
|
|
|
|
final File dictFile = ExpandableBinaryDictionary.getDictFile(
|
|
|
|
mContext, dictName, null /* dictFile */);
|
2013-10-03 11:55:34 +00:00
|
|
|
|
2013-08-16 05:17:09 +00:00
|
|
|
final int numberOfWords = 1000;
|
|
|
|
final Random random = new Random(123456);
|
2012-10-05 06:12:50 +00:00
|
|
|
|
2013-08-16 05:17:09 +00:00
|
|
|
try {
|
2014-02-13 07:16:44 +00:00
|
|
|
clearHistory(dummyLocale);
|
|
|
|
addAndWriteRandomWords(dummyLocale, numberOfWords, random,
|
2013-09-06 13:12:52 +00:00
|
|
|
true /* checksContents */);
|
2013-08-16 05:17:09 +00:00
|
|
|
} finally {
|
2013-10-03 11:55:34 +00:00
|
|
|
Log.d(TAG, "waiting for writing ...");
|
2014-02-13 07:16:44 +00:00
|
|
|
waitForWriting(dummyLocale);
|
|
|
|
assertTrue("check exisiting of " + dictFile, dictFile.exists());
|
|
|
|
FileUtils.deleteRecursively(dictFile);
|
2012-08-20 10:29:20 +00:00
|
|
|
}
|
|
|
|
}
|
2013-07-16 03:17:56 +00:00
|
|
|
|
|
|
|
public void testStressTestForSwitchingLanguagesAndAddingWords() {
|
|
|
|
final int numberOfLanguages = 2;
|
2013-08-16 05:17:09 +00:00
|
|
|
final int numberOfLanguageSwitching = 80;
|
|
|
|
final int numberOfWordsInsertedForEachLanguageSwitch = 100;
|
2013-07-16 03:17:56 +00:00
|
|
|
|
|
|
|
final File dictFiles[] = new File[numberOfLanguages];
|
2014-02-13 07:16:44 +00:00
|
|
|
final Locale dummyLocales[] = new Locale[numberOfLanguages];
|
2013-07-16 03:17:56 +00:00
|
|
|
try {
|
|
|
|
final Random random = new Random(123456);
|
|
|
|
|
2013-08-16 05:17:09 +00:00
|
|
|
// Create filename suffixes for this test.
|
2013-07-16 03:17:56 +00:00
|
|
|
for (int i = 0; i < numberOfLanguages; i++) {
|
2014-08-13 06:51:16 +00:00
|
|
|
dummyLocales[i] = new Locale(TEST_LOCALE_PREFIX + "switching_languages" + i);
|
2014-02-13 07:16:44 +00:00
|
|
|
final String dictName = ExpandableBinaryDictionary.getDictName(
|
|
|
|
UserHistoryDictionary.NAME, dummyLocales[i], null /* dictFile */);
|
|
|
|
dictFiles[i] = ExpandableBinaryDictionary.getDictFile(
|
|
|
|
mContext, dictName, null /* dictFile */);
|
|
|
|
clearHistory(dummyLocales[i]);
|
2013-07-16 03:17:56 +00:00
|
|
|
}
|
|
|
|
|
2013-08-16 05:17:09 +00:00
|
|
|
final long start = System.currentTimeMillis();
|
2013-07-16 03:17:56 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < numberOfLanguageSwitching; i++) {
|
|
|
|
final int index = i % numberOfLanguages;
|
2013-08-16 05:17:09 +00:00
|
|
|
// Switch languages to testFilenameSuffixes[index].
|
2014-02-13 07:16:44 +00:00
|
|
|
addAndWriteRandomWords(dummyLocales[index],
|
2013-09-06 13:12:52 +00:00
|
|
|
numberOfWordsInsertedForEachLanguageSwitch, random,
|
|
|
|
false /* checksContents */);
|
2013-07-16 03:17:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
final long end = System.currentTimeMillis();
|
|
|
|
Log.d(TAG, "testStressTestForSwitchingLanguageAndAddingWords took "
|
2013-08-16 05:17:09 +00:00
|
|
|
+ (end - start) + " ms");
|
|
|
|
} finally {
|
2013-10-03 11:55:34 +00:00
|
|
|
Log.d(TAG, "waiting for writing ...");
|
|
|
|
for (int i = 0; i < numberOfLanguages; i++) {
|
2014-02-13 07:16:44 +00:00
|
|
|
waitForWriting(dummyLocales[i]);
|
2013-07-16 03:17:56 +00:00
|
|
|
}
|
2014-02-13 07:16:44 +00:00
|
|
|
for (final File dictFile : dictFiles) {
|
|
|
|
assertTrue("check exisiting of " + dictFile, dictFile.exists());
|
|
|
|
FileUtils.deleteRecursively(dictFile);
|
2013-07-16 03:17:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-09-24 13:57:15 +00:00
|
|
|
|
|
|
|
public void testAddManyWords() {
|
2014-08-13 06:51:16 +00:00
|
|
|
final Locale dummyLocale =
|
|
|
|
new Locale(TEST_LOCALE_PREFIX + "random_words" + System.currentTimeMillis());
|
2014-02-13 07:16:44 +00:00
|
|
|
final String dictName = ExpandableBinaryDictionary.getDictName(
|
|
|
|
UserHistoryDictionary.NAME, dummyLocale, null /* dictFile */);
|
|
|
|
final File dictFile = ExpandableBinaryDictionary.getDictFile(
|
|
|
|
mContext, dictName, null /* dictFile */);
|
2013-12-13 08:09:16 +00:00
|
|
|
final int numberOfWords = 10000;
|
2013-09-24 13:57:15 +00:00
|
|
|
final Random random = new Random(123456);
|
2014-02-13 07:16:44 +00:00
|
|
|
clearHistory(dummyLocale);
|
2013-09-24 13:57:15 +00:00
|
|
|
try {
|
2014-02-13 07:16:44 +00:00
|
|
|
addAndWriteRandomWords(dummyLocale, numberOfWords, random, true /* checksContents */);
|
2013-09-24 13:57:15 +00:00
|
|
|
} finally {
|
2013-10-03 11:55:34 +00:00
|
|
|
Log.d(TAG, "waiting for writing ...");
|
2014-02-13 07:16:44 +00:00
|
|
|
waitForWriting(dummyLocale);
|
2014-08-12 13:29:02 +00:00
|
|
|
if (!dictFile.exists()) {
|
|
|
|
try {
|
|
|
|
Log.d(TAG, dictFile +" is not existing. Wait "
|
|
|
|
+ WAIT_FOR_WRITING_FILE_IN_MILLISECONDS + " ms for writing.");
|
2014-08-13 06:51:34 +00:00
|
|
|
printAllFiles(dictFile.getParentFile());
|
2014-08-12 13:29:02 +00:00
|
|
|
Thread.sleep(WAIT_FOR_WRITING_FILE_IN_MILLISECONDS);
|
|
|
|
} catch (final InterruptedException e) {
|
|
|
|
Log.e(TAG, "Interrupted during waiting for writing the dict file.");
|
|
|
|
}
|
|
|
|
}
|
2014-02-13 07:16:44 +00:00
|
|
|
assertTrue("check exisiting of " + dictFile, dictFile.exists());
|
|
|
|
FileUtils.deleteRecursively(dictFile);
|
2013-09-24 13:57:15 +00:00
|
|
|
}
|
|
|
|
}
|
2014-02-20 09:36:46 +00:00
|
|
|
|
|
|
|
public void testDecaying() {
|
2014-08-13 06:51:16 +00:00
|
|
|
final Locale dummyLocale =
|
|
|
|
new Locale(TEST_LOCALE_PREFIX + "decaying" + System.currentTimeMillis());
|
2014-02-20 09:36:46 +00:00
|
|
|
final int numberOfWords = 5000;
|
|
|
|
final Random random = new Random(123456);
|
2014-02-20 12:23:57 +00:00
|
|
|
resetCurrentTimeForTestMode();
|
2014-02-20 09:36:46 +00:00
|
|
|
clearHistory(dummyLocale);
|
|
|
|
final List<String> words = generateWords(numberOfWords, random);
|
|
|
|
final UserHistoryDictionary dict =
|
|
|
|
PersonalizationHelper.getUserHistoryDictionary(getContext(), dummyLocale);
|
2014-02-20 12:23:57 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2014-06-25 05:14:37 +00:00
|
|
|
PrevWordsInfo prevWordsInfo = PrevWordsInfo.EMPTY_PREV_WORDS_INFO;
|
2014-02-20 09:36:46 +00:00
|
|
|
for (final String word : words) {
|
2014-05-26 08:28:27 +00:00
|
|
|
UserHistoryDictionary.addToDictionary(dict, prevWordsInfo, word, true, mCurrentTime,
|
|
|
|
DistracterFilter.EMPTY_DISTRACTER_FILTER);
|
2014-06-25 05:14:37 +00:00
|
|
|
prevWordsInfo = prevWordsInfo.getNextPrevWordsInfo(new WordInfo(word));
|
2014-04-28 11:56:01 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2014-06-09 02:04:28 +00:00
|
|
|
assertTrue(dict.isInDictionary(word));
|
2014-02-20 09:36:46 +00:00
|
|
|
}
|
|
|
|
forcePassingShortTime();
|
2014-02-28 09:17:09 +00:00
|
|
|
dict.runGCIfRequired();
|
2014-02-20 12:23:57 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2014-02-20 09:36:46 +00:00
|
|
|
for (final String word : words) {
|
2014-06-09 02:04:28 +00:00
|
|
|
assertTrue(dict.isInDictionary(word));
|
2014-02-20 09:36:46 +00:00
|
|
|
}
|
|
|
|
forcePassingLongTime();
|
2014-02-28 09:17:09 +00:00
|
|
|
dict.runGCIfRequired();
|
2014-02-20 12:23:57 +00:00
|
|
|
dict.waitAllTasksForTests();
|
2014-02-20 09:36:46 +00:00
|
|
|
for (final String word : words) {
|
2014-06-09 02:04:28 +00:00
|
|
|
assertFalse(dict.isInDictionary(word));
|
2014-02-20 09:36:46 +00:00
|
|
|
}
|
|
|
|
}
|
2012-08-20 10:29:20 +00:00
|
|
|
}
|