Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

WorkManagerTestInitHelper

public final class WorkManagerTestInitHelper
extends Object

java.lang.Object
   ↳ androidx.work.testing.WorkManagerTestInitHelper


Helps initialize WorkManager for testing.

Summary

Public methods

static TestDriver getTestDriver(Context context)
static TestDriver getTestDriver()

This method is deprecated. Call getTestDriver(Context) instead.

static void initializeTestWorkManager(Context context)

Initializes a test WorkManager with a SynchronousExecutor.

static void initializeTestWorkManager(Context context, Configuration configuration)

Initializes a test WorkManager with a user-specified Configuration.

Inherited methods

Public methods

getTestDriver

public static TestDriver getTestDriver (Context context)

Parameters
context Context

Returns
TestDriver An instance of TestDriver. This exposes additional functionality that is useful in the context of testing when using WorkManager.

getTestDriver

public static TestDriver getTestDriver ()

This method is deprecated.
Call getTestDriver(Context) instead.

Returns
TestDriver An instance of TestDriver. This exposes additional functionality that is useful in the context of testing when using WorkManager.

initializeTestWorkManager

public static void initializeTestWorkManager (Context context)

Initializes a test WorkManager with a SynchronousExecutor.

Parameters
context Context: The application Context

initializeTestWorkManager

public static void initializeTestWorkManager (Context context, 
                Configuration configuration)

Initializes a test WorkManager with a user-specified Configuration.

Parameters
context Context: The application Context

configuration Configuration: The Configuration