Class BackgroundExecutor
java.lang.Object
org.robolectric.android.util.concurrent.BackgroundExecutor
Utility class for running code off the main looper thread aka Robolectric test thread.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
runInBackground
(Runnable runnable) A helper method intended for testing production code that needs to run off the main Looper.static <T> T
runInBackground
(Callable<T> callable) A helper method intended for testing production code that needs to run off the main Looper.
-
Method Details
-
runInBackground
A helper method intended for testing production code that needs to run off the main Looper. Will execute given runnable in a background thread and will do a best-effort attempt at propagating any exception back up to caller in their original form. -
runInBackground
A helper method intended for testing production code that needs to run off the main Looper.Will execute given callable in a background thread and will do a best-effort attempt at propagating any exception back up to caller in their original form.
-