IdlingResourceRegistry


@Singleton
class IdlingResourceRegistry


Keeps track of user-registered IdlingResources. Consider using instead of this class.

Summary

Public constructors

Public functions

(Mutable)List<IdlingResource!>!

Returns a list of all currently registered IdlingResources.

Unit
registerLooper(looper: Looper!, considerWaitIdle: Boolean)
Boolean

Registers the given resources.

Unit
sync(
    resources: (Mutable)Iterable<IdlingResource!>!,
    loopers: (Mutable)Iterable<Looper!>!
)

Ensures that this idling resource registry is in sync with given resources by registering/un-registering idling resources as needed.

Boolean

Unregisters the given resources.

Public constructors

IdlingResourceRegistry

IdlingResourceRegistry(looper: Looper!)

Public functions

getResources

fun getResources(): (Mutable)List<IdlingResource!>!

Returns a list of all currently registered IdlingResources. This method is safe to call from any thread.

Returns
(Mutable)List<IdlingResource!>!

an immutable List of IdlingResources.

registerLooper

fun registerLooper(looper: Looper!, considerWaitIdle: Boolean): Unit

registerResources

fun registerResources(resourceList: (Mutable)List<IdlingResource!>!): Boolean

Registers the given resources. If any of the given resources are already registered, a warning is logged.

Returns
Boolean

true if all resources were successfully registered

sync

fun sync(
    resources: (Mutable)Iterable<IdlingResource!>!,
    loopers: (Mutable)Iterable<Looper!>!
): Unit

Ensures that this idling resource registry is in sync with given resources by registering/un-registering idling resources as needed.

unregisterResources

fun unregisterResources(resourceList: (Mutable)List<IdlingResource!>!): Boolean

Unregisters the given resources. If any of the given resources are not already registered, a warning is logged.

Returns
Boolean

true if all resources were successfully unregistered