Package org.robolectric.annotation
Annotation Type Config
Configuration settings that can be used on a per-class or per-test basis.
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass
<? extends Application> TheApplication
class to use in the test, this takes precedence over any application specified in the AndroidManifest.xml.float
The default font scale.String[]
A list of instrumented packages, in addition to those that are already instrumented.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
The maximum Android SDK level to emulate when running tests on multiple API versions.int
The minimum Android SDK level to emulate when running tests on multiple API versions.Qualifiers specifying device configuration for this test, such as "fr-normal-port-hdpi".int[]
The Android SDK level to emulate.Class<?>[]
A list of shadow classes to enable, in addition to those that are already present. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final Class
<? extends Application> static final float
static final String
static final String
static final int
static final String
static final int
static final String
TODO(vnayar): Create named constants for default values instead of magic numbers.static final int
static final int
-
Field Details
-
NONE
TODO(vnayar): Create named constants for default values instead of magic numbers. Array named constants must be avoided in order to dodge a JDK 1.7 bug. error: annotation Config is missing value for the attribute <clinit> See JDK-8013485.- See Also:
-
DEFAULT_VALUE_STRING
- See Also:
-
DEFAULT_VALUE_INT
static final int DEFAULT_VALUE_INT- See Also:
-
DEFAULT_FONT_SCALE
static final float DEFAULT_FONT_SCALE- See Also:
-
DEFAULT_MANIFEST_NAME
- See Also:
-
DEFAULT_APPLICATION
-
DEFAULT_QUALIFIERS
- See Also:
-
ALL_SDKS
static final int ALL_SDKS- See Also:
-
TARGET_SDK
static final int TARGET_SDK- See Also:
-
OLDEST_SDK
static final int OLDEST_SDK- See Also:
-
NEWEST_SDK
static final int NEWEST_SDK- See Also:
-
-
Element Details
-
sdk
int[] sdkThe Android SDK level to emulate. This value will also be set as Build.VERSION.SDK_INT.- Default:
{}
-
minSdk
int minSdkThe minimum Android SDK level to emulate when running tests on multiple API versions.- Default:
-1
-
maxSdk
int maxSdkThe maximum Android SDK level to emulate when running tests on multiple API versions.- Default:
-1
-
fontScale
float fontScaleThe default font scale. In U+, users will have a slider to determine font scale. In all previous APIs, font scales are either small (0.85f), normal (1.0f), large (1.15f) or huge (1.3f)- Default:
1.0f
-
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/The Android manifest file to load; Robolectric will look relative to the current directory. Resources and assets will be loaded relative to the manifest.If not specified, Robolectric defaults to
AndroidManifest.xml
.If your project has no manifest or resources, use
NONE
.- Returns:
- The Android manifest file to load.
- Default:
"--default"
-
application
Class<? extends Application> applicationTheApplication
class to use in the test, this takes precedence over any application specified in the AndroidManifest.xml.- Returns:
- The
Application
class to use in the test.
- Default:
org.robolectric.annotation.DefaultApplication.class
-
qualifiers
String qualifiersQualifiers specifying device configuration for this test, such as "fr-normal-port-hdpi".If the string is prefixed with '+', the qualifiers that follow are overlaid on any more broadly-scoped qualifiers.
- Returns:
- Qualifiers used for device configuration and resource resolution.
- See Also:
- Default:
""
-
shadows
Class<?>[] shadowsA list of shadow classes to enable, in addition to those that are already present.- Returns:
- A list of additional shadow classes to enable.
- Default:
{}
-
instrumentedPackages
String[] instrumentedPackagesA list of instrumented packages, in addition to those that are already instrumented.- Returns:
- A list of additional instrumented packages.
- Default:
{}
-