java.lang.Object | |
↳ | android.support.test.InstrumentationRegistry |
An exposed registry instance that holds a reference to the instrumentation running in the process and it's arguments. Also provides an easy way for callers to get a hold of instrumentation, application context and instrumentation arguments Bundle.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a copy of instrumentation arguments Bundle.
| |||||||||||
Return the Context of this instrumentation's package.
| |||||||||||
Returns the instrumentation currently running.
| |||||||||||
Return a Context for the target application being instrumented.
| |||||||||||
Records/exposes the instrumentation currently running and stores a copy of the
instrumentation arguments Bundle in the registry.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns a copy of instrumentation arguments Bundle. Use this to get a Bundle
containing the command line arguments passed to Instrumentation
into your test.
This Bundle is not guaranteed to be present under all instrumentations.
IllegalStateException | if no argument Bundle has been registered. |
---|
Return the Context of this instrumentation's package. Use this to get a
Context
representing getContext()
into your test.
Returns the instrumentation currently running. Use this to get an Instrumentation
into your test.
IllegalStateException | if instrumentation hasn't been registered |
---|
Return a Context for the target application being instrumented. Use this to get a
Context
representing getTargetContext()
into your test.
Records/exposes the instrumentation currently running and stores a copy of the instrumentation arguments Bundle in the registry.
This is a global registry - so be aware of the impact of calling this method!
instrumentation | the instrumentation currently running. |
---|---|
arguments | the arguments for this application. Null deregisters any existing arguments. |