androidx.work.testing

Classes

SynchronousExecutor

Is an implementation of a java.util.concurrent.Executor which executes 's synchronously.

TestListenableWorkerBuilder

Builds instances of androidx.work.ListenableWorker which can be used for testing.

TestWorkerBuilder

Builds instances of Worker which can be used for testing.

WorkManagerTestInitHelper

Helps initialize androidx.work.WorkManager for testing.

Top-level functions summary

TestListenableWorkerBuilder<W>
TestListenableWorkerBuilder(context: Context, inputData: Data = Data.EMPTY, tags: List<String> = listOf(), runAttemptCount: Int = 1, triggeredContentUris: List<Uri> = listOf(), triggeredContentAuthorities: List<String> = listOf())

Builds an instance of TestListenableWorkerBuilder.

TestWorkerBuilder<W>
TestWorkerBuilder(context: Context, executor: Executor, inputData: Data = Data.EMPTY, tags: List<String> = listOf(), runAttemptCount: Int = 1, triggeredContentUris: List<Uri> = listOf(), triggeredContentAuthorities: List<String> = listOf())

Builds an instance of TestWorkerBuilder.

Top-level functions

TestListenableWorkerBuilder

inline fun <reified W : ListenableWorker> TestListenableWorkerBuilder(context: Context, inputData: Data = Data.EMPTY, tags: List<String> = listOf(), runAttemptCount: Int = 1, triggeredContentUris: List<Uri> = listOf(), triggeredContentAuthorities: List<String> = listOf()): TestListenableWorkerBuilder<W>

Builds an instance of TestListenableWorkerBuilder.

Parameters
W The subtype of ListenableWorker
context The application Context
inputData The input data for the ListenableWorker
runAttemptCount The run attempt count of the ListenableWorker
triggeredContentUris The list of triggered content Uris
triggeredContentAuthorities The list of triggered content authorities
Return
The instance of TestListenableWorkerBuilder

TestWorkerBuilder

inline fun <reified W : Worker> TestWorkerBuilder(context: Context, executor: Executor, inputData: Data = Data.EMPTY, tags: List<String> = listOf(), runAttemptCount: Int = 1, triggeredContentUris: List<Uri> = listOf(), triggeredContentAuthorities: List<String> = listOf()): TestWorkerBuilder<W>

Builds an instance of TestWorkerBuilder.

Parameters
W The subtype of Worker
context The application Context
executor The Executor that the Worker runs on
inputData The input data for the Worker
runAttemptCount The run attempt count of the Worker
triggeredContentUris The list of triggered content Uris
triggeredContentAuthorities The list of triggered content authorities
Return
The instance of TestWorkerBuilder