Added in API level 1
Deprecated in API level 24

SingleLaunchActivityTestCase


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

If you would like to test a single activity with an android.test.InstrumentationTestCase, this provides some of the boiler plate to launch and finish the activity in setUp and tearDown. This launches the activity only once for the entire class instead of doing it in every setup / teardown call.

Summary

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

NOTE: The parameter pkg must refer to the package identifier of the package hosting the activity to be launched, which is specified in the AndroidManifest.

Public methods
open T

open Unit

Protected methods
open Unit

open Unit

Inherited functions

Public constructors

SingleLaunchActivityTestCase

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

NOTE: The parameter pkg must refer to the package identifier of the package hosting the activity to be launched, which is specified in the AndroidManifest.xml file. This is not necessarily the same as the java package name.

Parameters
pkg String!: The package hosting the activity to be launched.
activityClass Class<T>!: The activity to test.

Public methods

getActivity

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

Deprecated: Deprecated in Java.

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