From e332b531437a642e85e07703e5f20d143c4e6ab7 Mon Sep 17 00:00:00 2001 From: Dustin Lam Date: Fri, 12 Feb 2021 13:33:05 -0800 Subject: [PATCH] Fix + simplify PagingSample test --- BasicRxJavaSample/versions.gradle | 2 +- BasicRxJavaSampleKotlin/versions.gradle | 2 +- BasicSample/versions.gradle | 2 +- GithubBrowserSample/versions.gradle | 2 +- LiveDataSample/versions.gradle | 2 +- MADSkillsNavigationSample/versions.gradle | 2 +- NavigationAdvancedSample/versions.gradle | 2 +- NavigationBasicSample/versions.gradle | 2 +- .../android/example/com/pagingsample/MainActivityTest.kt | 6 ++---- .../paging/android/example/com/pagingsample/CheeseDb.kt | 2 +- PagingSample/versions.gradle | 2 +- PagingWithNetworkSample/versions.gradle | 2 +- PersistenceContentProviderSample/versions.gradle | 2 +- PersistenceMigrationsSample/versions.gradle | 2 +- ViewBindingSample/versions.gradle | 2 +- WorkManagerSample/versions.gradle | 2 +- versions.gradle | 2 +- 17 files changed, 18 insertions(+), 20 deletions(-) diff --git a/BasicRxJavaSample/versions.gradle b/BasicRxJavaSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/BasicRxJavaSample/versions.gradle +++ b/BasicRxJavaSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/BasicRxJavaSampleKotlin/versions.gradle b/BasicRxJavaSampleKotlin/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/BasicRxJavaSampleKotlin/versions.gradle +++ b/BasicRxJavaSampleKotlin/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/BasicSample/versions.gradle b/BasicSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/BasicSample/versions.gradle +++ b/BasicSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/GithubBrowserSample/versions.gradle b/GithubBrowserSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/GithubBrowserSample/versions.gradle +++ b/GithubBrowserSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/LiveDataSample/versions.gradle b/LiveDataSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/LiveDataSample/versions.gradle +++ b/LiveDataSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/MADSkillsNavigationSample/versions.gradle b/MADSkillsNavigationSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/MADSkillsNavigationSample/versions.gradle +++ b/MADSkillsNavigationSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/NavigationAdvancedSample/versions.gradle b/NavigationAdvancedSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/NavigationAdvancedSample/versions.gradle +++ b/NavigationAdvancedSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/NavigationBasicSample/versions.gradle b/NavigationBasicSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/NavigationBasicSample/versions.gradle +++ b/NavigationBasicSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/PagingSample/app/src/androidTest/java/paging/android/example/com/pagingsample/MainActivityTest.kt b/PagingSample/app/src/androidTest/java/paging/android/example/com/pagingsample/MainActivityTest.kt index a07ac8a3a..b03807fd5 100644 --- a/PagingSample/app/src/androidTest/java/paging/android/example/com/pagingsample/MainActivityTest.kt +++ b/PagingSample/app/src/androidTest/java/paging/android/example/com/pagingsample/MainActivityTest.kt @@ -20,8 +20,7 @@ import androidx.recyclerview.widget.RecyclerView import androidx.test.core.app.ActivityScenario import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 -import org.hamcrest.CoreMatchers -import org.hamcrest.MatcherAssert +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith import java.util.concurrent.TimeoutException @@ -41,8 +40,7 @@ class MainActivityTest { scenario.onActivity { activity -> val recyclerView: RecyclerView = activity.binding.cheeseList - MatcherAssert.assertThat(recyclerView.adapter, CoreMatchers.notNullValue()) - MatcherAssert.assertThat(recyclerView.adapter!!.itemCount > 0, CoreMatchers.`is`(true)) + assertEquals(CHEESE_DATA.size, recyclerView.adapter!!.itemCount) } } } \ No newline at end of file diff --git a/PagingSample/app/src/main/java/paging/android/example/com/pagingsample/CheeseDb.kt b/PagingSample/app/src/main/java/paging/android/example/com/pagingsample/CheeseDb.kt index d4ec91363..860c013eb 100644 --- a/PagingSample/app/src/main/java/paging/android/example/com/pagingsample/CheeseDb.kt +++ b/PagingSample/app/src/main/java/paging/android/example/com/pagingsample/CheeseDb.kt @@ -58,7 +58,7 @@ abstract class CheeseDb : RoomDatabase() { } -private val CHEESE_DATA = arrayListOf( +val CHEESE_DATA = arrayListOf( "Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi", "Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu", "Airag", "Airedale", "Aisy Cendre", "Allgauer Emmentaler", "Alverca", "Ambert", "American Cheese", diff --git a/PagingSample/versions.gradle b/PagingSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/PagingSample/versions.gradle +++ b/PagingSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/PagingWithNetworkSample/versions.gradle b/PagingWithNetworkSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/PagingWithNetworkSample/versions.gradle +++ b/PagingWithNetworkSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/PersistenceContentProviderSample/versions.gradle b/PersistenceContentProviderSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/PersistenceContentProviderSample/versions.gradle +++ b/PersistenceContentProviderSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/PersistenceMigrationsSample/versions.gradle b/PersistenceMigrationsSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/PersistenceMigrationsSample/versions.gradle +++ b/PersistenceMigrationsSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/ViewBindingSample/versions.gradle b/ViewBindingSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/ViewBindingSample/versions.gradle +++ b/ViewBindingSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/WorkManagerSample/versions.gradle b/WorkManagerSample/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/WorkManagerSample/versions.gradle +++ b/WorkManagerSample/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2" diff --git a/versions.gradle b/versions.gradle index ecb4df3df..9fe7e1577 100644 --- a/versions.gradle +++ b/versions.gradle @@ -52,7 +52,7 @@ versions.mockito_android = "2.25.0" versions.mockwebserver = "3.8.1" versions.navigation = "2.3.0-alpha01" versions.okhttp_logging_interceptor = "3.9.0" -versions.paging = "3.0.0-alpha13" +versions.paging = "3.0.0-beta01" versions.recyclerview = "1.2.0-beta01" versions.retrofit = "2.9.0" versions.robolectric = "4.2"