diff options
author | 2019-09-05 16:53:24 +0000 | |
---|---|---|
committer | 2019-09-05 16:53:24 +0000 | |
commit | ccb19fdda7a4ef49eeb6195b6a43ffedb269c670 (patch) | |
tree | 06816df073e9c2aedd67f8806efed9e31d25517f /tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java | |
parent | c8db60faa55ef3ee9780b13ce361f5c08756a5f1 (diff) | |
parent | 66fb808791b86e7e0903a834fdfa187132ea0bdf (diff) | |
download | latinime-ccb19fdda7a4ef49eeb6195b6a43ffedb269c670.tar.gz latinime-ccb19fdda7a4ef49eeb6195b6a43ffedb269c670.tar.xz latinime-ccb19fdda7a4ef49eeb6195b6a43ffedb269c670.zip |
Merge "DO NOT MERGE - Merge Android 10 into master"
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java index 0cbb02c4f..da23c9cb8 100644 --- a/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/CollectionUtilsTests.java @@ -16,11 +16,19 @@ package com.android.inputmethod.latin.utils; -import android.test.AndroidTestCase; -import android.test.suitebuilder.annotation.SmallTest; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import androidx.test.filters.SmallTest; +import androidx.test.runner.AndroidJUnit4; import com.android.inputmethod.latin.common.CollectionUtils; +import org.junit.Test; +import org.junit.runner.RunWith; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -32,11 +40,13 @@ import java.util.Map; * Tests for {@link CollectionUtils}. */ @SmallTest -public class CollectionUtilsTests extends AndroidTestCase { +@RunWith(AndroidJUnit4.class) +public class CollectionUtilsTests { /** * Tests that {@link CollectionUtils#arrayAsList(Object[],int,int)} fails as expected * with some invalid inputs. */ + @Test public void testArrayAsListFailure() { final String[] array = { "0", "1" }; // Negative start @@ -66,6 +76,7 @@ public class CollectionUtilsTests extends AndroidTestCase { * Tests that {@link CollectionUtils#arrayAsList(Object[],int,int)} gives the expected * results for a few valid inputs. */ + @Test public void testArrayAsList() { final ArrayList<String> empty = new ArrayList<>(); assertEquals(empty, CollectionUtils.arrayAsList(new String[] {}, 0, 0)); @@ -81,6 +92,7 @@ public class CollectionUtilsTests extends AndroidTestCase { * Tests that {@link CollectionUtils#isNullOrEmpty(java.util.Collection)} gives the expected * results for a few cases. */ + @Test public void testIsNullOrEmpty() { assertTrue(CollectionUtils.isNullOrEmpty((List<String>) null)); assertTrue(CollectionUtils.isNullOrEmpty((Map<String, String>) null)); |