BackupRestoreConfig


@MustBeDocumented
@Retention(value = AnnotationRetention.RUNTIME)
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation BackupRestoreConfig


Defines global configuration parameters for the Automated Backup and Restore test runner suite.

Applies to the annotated test class and to its @Nested test classes, which can override individual attributes.

Tests whose test suite properties name the tested app don't need this annotation: without it, they target that app.

Summary

Public constructors

BackupRestoreConfig(applicationId: String, testApplicationId: String)

Public properties

String

The target application ID/package name being tested, such as "com.example.myapp".

String

The package name of the test APK whose androidx.test.backup.BackupRestoreTestRunner runs the device actions, such as "com.example.myapp.test".

Public constructors

BackupRestoreConfig

Added in 1.0.0-alpha04
BackupRestoreConfig(applicationId: String = "", testApplicationId: String = "")

Public properties

applicationId

val applicationId: String

The target application ID/package name being tested, such as "com.example.myapp". Defaults to "", which uses the applicationId of an enclosing class, or else the tested app that the test suite properties name.

testApplicationId

val testApplicationId: String

The package name of the test APK whose androidx.test.backup.BackupRestoreTestRunner runs the device actions, such as "com.example.myapp.test". Needed only when several installed test APKs have that runner for the app. Defaults to "", which uses the testApplicationId of the nearest enclosing class that sets one, unless this class or a class in between sets applicationId. Without one, it uses the only such test APK, or else the one named <applicationId>.test. Device actions fail if the test APK that it names isn't installed or has no such runner for the app.