@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface Config
| Modifier and Type | Fields and Description |
|---|---|
static int |
ALL_SDKS |
static java.lang.String |
DEFAULT_ABI_SPLIT |
static java.lang.Class<? extends android.app.Application> |
DEFAULT_APPLICATION |
static java.lang.String |
DEFAULT_ASSET_FOLDER |
static java.lang.String |
DEFAULT_BUILD_FOLDER |
static java.lang.String |
DEFAULT_MANIFEST_NAME |
static java.lang.String |
DEFAULT_PACKAGE_NAME |
static java.lang.String |
DEFAULT_QUALIFIERS |
static java.lang.String |
DEFAULT_RES_FOLDER |
static int |
DEFAULT_VALUE_INT |
static java.lang.String |
DEFAULT_VALUE_STRING |
static int |
NEWEST_SDK |
static java.lang.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 and Description |
|---|---|
java.lang.String |
abiSplit
The ABI split to use when locating resources and AndroidManifest.xml
|
java.lang.Class<? extends android.app.Application> |
application
The
Application class to use in the test, this takes precedence over any application
specified in the AndroidManifest.xml. |
java.lang.String |
assetDir
The directory from which to load assets.
|
java.lang.String |
buildDir
The directory where application files are created during the application build process.
|
java.lang.Class<?> |
constants
Reference to the BuildConfig class created by the Gradle build system.
|
java.lang.String[] |
instrumentedPackages
A list of instrumented packages, in addition to those that are already instrumented.
|
java.lang.String[] |
libraries
A list of folders containing Android Libraries on which this project depends.
|
java.lang.String |
manifest
The Android manifest file to load; Robolectric will look relative to the current directory.
|
int |
maxSdk
The minimum 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.
|
java.lang.String |
packageName
Java package name where the "R.class" file is located.
|
java.lang.String |
qualifiers
Qualifiers for the resource resolution, such as "fr-normal-port-hdpi".
|
java.lang.String |
resourceDir
The directory from which to load resources.
|
int[] |
sdk
The Android SDK level to emulate.
|
java.lang.Class<?>[] |
shadows
A list of shadow classes to enable, in addition to those that are already present.
|
public static final java.lang.String NONE
public static final java.lang.Class<? extends android.app.Application> DEFAULT_APPLICATION
public abstract int[] sdk
public abstract int minSdk
public abstract int maxSdk
public abstract java.lang.String manifest
AndroidManifest.xml.
If your project has no manifest or resources, use NONE.public abstract java.lang.Class<?> constants
public abstract java.lang.Class<? extends android.app.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.public abstract java.lang.String packageName
applicationId associated with productFlavors or specify applicationIdSuffix
in your build.gradle.
If not specified, Robolectric defaults to the applicationId.
public abstract java.lang.String abiSplit
You do not typically have to set this, unless you are utilizing the ABI split feature
public abstract java.lang.String qualifiers
public abstract java.lang.String resourceDir
If not specified, Robolectric defaults to res.
public abstract java.lang.String assetDir
If not specified, Robolectric defaults to assets.
public abstract java.lang.String buildDir
If not specified, Robolectric defaults to build.
public abstract java.lang.Class<?>[] shadows