IdlingRegistry
public
final
class
IdlingRegistry
extends Object
java.lang.Object | |
↳ | android.support.test.espresso.IdlingRegistry |
Handles registering and unregistering of IdlingResource
s with Espresso from within your
application code.
These resources are required by Espresso to provide synchronisation against your application code. All registered resources with this registry will be automatically synchronized against for each Espresso interaction.
This registry along with IdlingResource
interface are bundled together in a small
light weight module so that it can be pulled in as a dependency of the App under test with close
to no overhead.
Summary
Public methods | |
---|---|
static
IdlingRegistry
|
getInstance()
Returns a singleton instance of this |
Collection<Looper>
|
getLoopers()
|
Collection<IdlingResource>
|
getResources()
Returns a set of all currently registered |
boolean
|
register(IdlingResource... idlingResources)
Registers one or more |
void
|
registerLooperAsIdlingResource(Looper looper)
Registers a |
boolean
|
unregister(IdlingResource... idlingResources)
Unregisters one or more |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public methods
getInstance
IdlingRegistry getInstance ()
Returns a singleton instance of this IdlingRegistry
that should be globally used for
registering and unregistering IdlingResource
s
Returns | |
---|---|
IdlingRegistry |
getLoopers
Collection<Looper> getLoopers ()
Returns | |
---|---|
Collection<Looper> |
a set of all currently registered Looper s. |
getResources
Collection<IdlingResource> getResources ()
Returns a set of all currently registered IdlingResource
s.
Returns | |
---|---|
Collection<IdlingResource> |
register
boolean register (IdlingResource... idlingResources)
Registers one or more IdlingResource
s. When registering more than one resource, ensure
that each has a unique name returned from getName()
Parameters | |
---|---|
idlingResources |
IdlingResource |
Returns | |
---|---|
boolean |
true if at least one resource was successfully added to the registry
|
registerLooperAsIdlingResource
void registerLooperAsIdlingResource (Looper looper)
Registers a Looper
for idle checking with the framework. This is intended for use with
non-UI thread Looper
s only.
Parameters | |
---|---|
looper |
Looper |
Throws | |
---|---|
IllegalArgumentException |
if looper is the main looper. |
NullPointerException |
if looper is null. |
unregister
boolean unregister (IdlingResource... idlingResources)
Unregisters one or more IdlingResource
s.
Parameters | |
---|---|
idlingResources |
IdlingResource |
Returns | |
---|---|
boolean |
true if at least one resource was successfully removed from the registry
|
Interfaces
Classes
Exceptions