@Documented @Inherited @Retention(RUNTIME) @Target({TYPE,METHOD}) public @interface Config
Modifier and Type | Fields | Description |
---|---|---|
static int |
ALL_SDKS |
|
static Class<? extends Application> |
DEFAULT_APPLICATION |
|
static String |
DEFAULT_ASSET_FOLDER |
|
static String |
DEFAULT_MANIFEST_NAME |
|
static String |
DEFAULT_PACKAGE_NAME |
|
static String |
DEFAULT_QUALIFIERS |
|
static String |
DEFAULT_RES_FOLDER |
|
static int |
DEFAULT_VALUE_INT |
|
static String |
DEFAULT_VALUE_STRING |
|
static int |
NEWEST_SDK |
|
static String |
NONE |
TODO(vnayar): Create named constants for default values instead of magic numbers.
|
static int |
OLDEST_SDK |
|
static int |
TARGET_SDK |
Modifier and Type | Optional Element | Description |
---|---|---|
Class<? extends Application> |
application |
The
Application class to use in the test, this takes precedence over any application
specified in the AndroidManifest.xml. |
String |
assetDir |
Deprecated.
If you are using at least Android Studio 3.0 alpha 5 or Bazel's android_local_test
please migrate to the preferred way to configure
|
String[] |
instrumentedPackages |
A list of instrumented packages, in addition to those that are already instrumented.
|
String[] |
libraries |
Deprecated.
If you are using at least Android Studio 3.0 alpha 5 or Bazel's android_local_test
please migrate to the preferred way to configure
|
String |
manifest |
Deprecated.
If you are using at least Android Studio 3.0 alpha 5 or Bazel's android_local_test
please migrate to the preferred way to configure
builds http://robolectric.org/getting-started/
|
int |
maxSdk |
The maximum Android SDK level to emulate when running tests on multiple API versions.
|
int |
minSdk |
The minimum Android SDK level to emulate when running tests on multiple API versions.
|
String |
packageName |
Deprecated.
To change your package name please override the applicationId in your build system.
Changing package name here is broken as the package name will no longer match the package
name encoded in the arsc resources file. If you are looking to simulate another application
you can create another applications Context using
Context.createPackageContext(String, int) . Note that you must add this
package to ShadowPackageManager.addPackage(android.content.pm.PackageInfo)
first. |
String |
qualifiers |
Qualifiers specifying device configuration for this test, such as "fr-normal-port-hdpi".
|
String |
resourceDir |
Deprecated.
If you are using at least Android Studio 3.0 alpha 5 or Bazel's android_local_test
please migrate to the preferred way to configure
|
int[] |
sdk |
The Android SDK level to emulate.
|
Class<?>[] |
shadows |
A list of shadow classes to enable, in addition to those that are already present.
|
static final String NONE
static final String DEFAULT_VALUE_STRING
static final String DEFAULT_MANIFEST_NAME
static final Class<? extends Application> DEFAULT_APPLICATION
static final String DEFAULT_PACKAGE_NAME
static final String DEFAULT_QUALIFIERS
static final String DEFAULT_RES_FOLDER
static final String DEFAULT_ASSET_FOLDER
int[] sdk
int minSdk
int maxSdk
@Deprecated String manifest
AndroidManifest.xml
.
If your project has no manifest or resources, use NONE
.Class<? extends Application> application
Application
class to use in the test, this takes precedence over any application
specified in the AndroidManifest.xml.Application
class to use in the test.@Deprecated String packageName
Context.createPackageContext(String, int)
. Note that you must add this
package to ShadowPackageManager.addPackage(android.content.pm.PackageInfo)
first.applicationId
associated with productFlavors
or specify
applicationIdSuffix
in your build.gradle.
If not specified, Robolectric defaults to the applicationId
.
String qualifiers
If the string is prefixed with '+', the qualifiers that follow are overlayed on any more broadly-scoped qualifiers.
@Deprecated String resourceDir
res
.@Deprecated String assetDir
assets
.Class<?>[] shadows
String[] instrumentedPackages
@Deprecated String[] libraries