Package org.robolectric.annotation
Annotation Type Config
-
@Documented @Inherited @Retention(RUNTIME) @Target({TYPE,METHOD}) public @interface ConfigConfiguration settings that can be used on a per-class or per-test basis.
-
-
Field Summary
Fields Modifier and Type Fields Description static intALL_SDKSstatic java.lang.Class<? extends android.app.Application>DEFAULT_APPLICATIONstatic java.lang.StringDEFAULT_ASSET_FOLDERstatic java.lang.StringDEFAULT_MANIFEST_NAMEstatic java.lang.StringDEFAULT_PACKAGE_NAMEstatic java.lang.StringDEFAULT_QUALIFIERSstatic java.lang.StringDEFAULT_RES_FOLDERstatic intDEFAULT_VALUE_INTstatic java.lang.StringDEFAULT_VALUE_STRINGstatic intNEWEST_SDKstatic java.lang.StringNONETODO(vnayar): Create named constants for default values instead of magic numbers.static intOLDEST_SDKstatic intTARGET_SDK
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.Class<? extends android.app.Application>applicationTheApplicationclass to use in the test, this takes precedence over any application specified in the AndroidManifest.xml.java.lang.StringassetDirDeprecated.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 configurejava.lang.String[]instrumentedPackagesA list of instrumented packages, in addition to those that are already instrumented.java.lang.String[]librariesDeprecated.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 configurejava.lang.StringmanifestDeprecated.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/intmaxSdkThe maximum Android SDK level to emulate when running tests on multiple API versions.intminSdkThe minimum Android SDK level to emulate when running tests on multiple API versions.java.lang.StringpackageNameDeprecated.To change your package name please override the applicationId in your build system.java.lang.StringqualifiersQualifiers specifying device configuration for this test, such as "fr-normal-port-hdpi".java.lang.StringresourceDirDeprecated.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 configureint[]sdkThe Android SDK level to emulate.java.lang.Class<?>[]shadowsA list of shadow classes to enable, in addition to those that are already present.
-
-
-
Field Detail
-
NONE
static final java.lang.String 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.
-
-
-
manifest
@Deprecated java.lang.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/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 toAndroidManifest.xml. If your project has no manifest or resources, useNONE.- Returns:
- The Android manifest file to load.
- Default:
- "--default"
-
-
-
application
java.lang.Class<? extends android.app.Application> application
TheApplicationclass to use in the test, this takes precedence over any application specified in the AndroidManifest.xml.- Returns:
- The
Applicationclass to use in the test.
- Default:
- org.robolectric.annotation.DefaultApplication.class
-
-
-
packageName
@Deprecated java.lang.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 usingContext.createPackageContext(String, int). Note that you must add this package toorg.robolectric.shadows.ShadowPackageManager#addPackage(android.content.pm.PackageInfo)first.Java package name where the "R.class" file is located. This only needs to be specified if you define anapplicationIdassociated withproductFlavorsor specifyapplicationIdSuffixin your build.gradle.If not specified, Robolectric defaults to the
applicationId.- Returns:
- The java package name for R.class.
- Default:
- ""
-
-
-
qualifiers
java.lang.String qualifiers
Qualifiers specifying device configuration for this test, such as "fr-normal-port-hdpi".If the string is prefixed with '+', the qualifiers that follow are overlayed on any more broadly-scoped qualifiers.
- Returns:
- Qualifiers used for device configuration and resource resolution.
- See Also:
- Device Configuration for details.
- Default:
- ""
-
-
-
resourceDir
@Deprecated java.lang.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 configureThe directory from which to load resources. This should be relative to the directory containing AndroidManifest.xml. If not specified, Robolectric defaults tores.- Returns:
- Android resource directory.
- Default:
- "res"
-
-
-
assetDir
@Deprecated java.lang.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 configureThe directory from which to load assets. This should be relative to the directory containing AndroidManifest.xml. If not specified, Robolectric defaults toassets.- Returns:
- Android asset directory.
- Default:
- "assets"
-
-
-
libraries
@Deprecated java.lang.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 configureA list of folders containing Android Libraries on which this project depends.- Returns:
- A list of Android Libraries.
- Default:
- {}
-
-