You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b0897a4
Browse filesBrowse the repository at this point in the historyBrowse files
Use Room's queryDispatcher over Dispatchers.IO in LimitOffsetPagingSource
Allows overriding the Dispatcher for Room's generated PagingSource
implementation, which is useful in testing.
RelNote: "The PagingSource implementation generated by room-paging now
uses the queryExecutor passed through RoomDatabase.Builder, so it can
be overridden, instead of Dispatchers.IO previously."
Test: ./gradlew room:room-paging:test
Change-Id: Iae2598b4c865904a295a1de1e6722bff14ed08cf
Copy file name to clipboardExpand all lines: room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/PagingSourceTest.kt
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ import org.junit.After
69
69
importorg.junit.Before
70
70
importorg.junit.Test
71
71
importorg.junit.runner.RunWith
72
+
importjava.util.concurrent.Executors
72
73
importkotlin.test.assertFailsWith
73
74
importkotlin.test.assertFalse
74
75
importkotlin.test.assertTrue
@@ -83,7 +84,10 @@ class PagingSourceTest {
83
84
privatelateinitvar coroutineScope:CoroutineScope
84
85
privatelateinitvar db:Paging3Db
85
86
privatelateinitvar itemStore:ItemStore
86
-
privateval queryExecutor =FilteringExecutor()
87
+
88
+
// Multiple threads are necessary to prevent deadlock, since Room will acquire a thread to
89
+
// dispatch on, when using the query / transaction dispatchers.
0 commit comments