Added in API level 1
Deprecated in API level 3

ActivityInstrumentationTestCase


abstract class ActivityInstrumentationTestCase<T : Activity!> : ActivityTestCase
kotlin.Any
   ↳ android.test.InstrumentationTestCase
   ↳ android.test.ActivityTestCase
   ↳ android.test.ActivityInstrumentationTestCase

This class provides functional testing of a single activity. The activity under test will be created using the system infrastructure (by calling InstrumentationTestCase.launchActivity()) and you will then be able to manipulate your Activity directly. Most of the work is handled automatically here by setUp and tearDown.

If you prefer an isolated unit test, see android.test.ActivityUnitTestCase.

Summary

Public constructors
ActivityInstrumentationTestCase(pkg: String!, activityClass: Class<T>!)

Creates an ActivityInstrumentationTestCase in non-touch mode.

ActivityInstrumentationTestCase(pkg: String!, activityClass: Class<T>!, initialTouchMode: Boolean)

Creates an ActivityInstrumentationTestCase.

Public methods
open T

open Unit

Protected methods
open Unit

open Unit

Inherited functions

Public constructors

ActivityInstrumentationTestCase

Added in API level 1
ActivityInstrumentationTestCase(
    pkg: String!,
    activityClass: Class<T>!)

Creates an ActivityInstrumentationTestCase in non-touch mode.

Parameters
pkg String!: ignored - no longer in use.
activityClass Class<T>!: The activity to test. This must be a class in the instrumentation targetPackage specified in the AndroidManifest.xml

ActivityInstrumentationTestCase

Added in API level 1
ActivityInstrumentationTestCase(
    pkg: String!,
    activityClass: Class<T>!,
    initialTouchMode: Boolean)

Creates an ActivityInstrumentationTestCase.

Parameters
pkg String!: ignored - no longer in use.
activityClass Class<T>!: The activity to test. This must be a class in the instrumentation targetPackage specified in the AndroidManifest.xml
initialTouchMode Boolean: true = in touch mode

Public methods

getActivity

Added in API level 1
open fun getActivity(): T

Deprecated: Deprecated in Java.

Return
T Returns the activity under test.

testActivityTestCaseSetUpProperly

Added in API level 1
open fun testActivityTestCaseSetUpProperly(): Unit

Deprecated: Deprecated in Java.

Protected methods

setUp

Added in API level 1
protected open fun setUp(): Unit

Deprecated: Deprecated in Java.

tearDown

Added in API level 1
protected open fun tearDown(): Unit

Deprecated: Deprecated in Java.

Exceptions
java.lang.Exception