| java.lang.Object | |
| ↳ | androidx.test.InstrumentationRegistry |
This class is deprecated.
use ERROR(/androidx.test.core.app.ApplicationProvider) or InstrumentationRegistry instead
An exposed registry instance that holds a reference to the instrumentation running in the process and its arguments. Also provides an easy way for callers to get a hold of instrumentation, application context and instrumentation arguments Bundle.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
use
getArguments()
| |||||||||||
This method is deprecated.
In most scenarios,
ERROR(/androidx.test.core.app.ApplicationProvider#getApplicationContext()) should be used instead
of the instrumentation test context. If you do need access to the test context for to
access its resources, it is recommended to use getResourcesForApplication(String) instead.
| |||||||||||
This method is deprecated.
use
getInstrumentation()
| |||||||||||
This method is deprecated.
use
ERROR(/androidx.test.core.app.ApplicationProvider#getApplicationContext())
instead.
| |||||||||||
This method is deprecated.
use
getInstrumentation()
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||
This method is deprecated.
use getArguments()
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.
| Returns | |
|---|---|
Bundle |
Bundle the arguments for this instrumentation. |
| Throws | |
|---|---|
IllegalStateException |
if no argument Bundle has been registered. |
This method is deprecated.
In most scenarios, ERROR(/androidx.test.core.app.ApplicationProvider#getApplicationContext()) should be used instead
of the instrumentation test context. If you do need access to the test context for to
access its resources, it is recommended to use getResourcesForApplication(String) instead.
Return the Context of this instrumentation's package. Use this to get a Context
representing getContext() into your test.
| Returns | |
|---|---|
Context |
|
This method is deprecated.
use getInstrumentation()
Returns the instrumentation currently running. Use this to get an Instrumentation into
your test.
| Returns | |
|---|---|
Instrumentation |
|
| Throws | |
|---|---|
IllegalStateException |
if instrumentation hasn't been registered |
This method is deprecated.
use ERROR(/androidx.test.core.app.ApplicationProvider#getApplicationContext())
instead.
Return a Context for the target application being instrumented. Use this to get a Context representing getTargetContext() into your test.
| Returns | |
|---|---|
Context |
|
This method is deprecated.
use getInstrumentation()
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!
| Parameters | |
|---|---|
instrumentation |
Instrumentation: the instrumentation currently running. |
arguments |
Bundle: the arguments for this application. Null deregisters any existing arguments. |