Added in API level 1
Deprecated in API level 24

ActivityTestCase


abstract class ActivityTestCase : InstrumentationTestCase
kotlin.Any
   ↳ android.test.InstrumentationTestCase
   ↳ android.test.ActivityTestCase

This is common code used to support Activity test cases. For more useful classes, please see android.test.ActivityUnitTestCase and android.test.ActivityInstrumentationTestCase.

Summary

Public constructors

Protected methods
open Activity!

open Unit
scrubClass(testCaseClass: Class<*>!)

This function is called by various TestCase implementations, at tearDown() time, in order to scrub out any class variables.

open Unit
setActivity(testActivity: Activity!)

Set the activity under test.

Inherited functions

Public constructors

ActivityTestCase

ActivityTestCase()

Protected methods

getActivity

Added in API level 1
protected open fun getActivity(): Activity!

Deprecated: Deprecated in Java.

Return
Activity! Returns the activity under test.

scrubClass

Added in API level 1
protected open fun scrubClass(testCaseClass: Class<*>!): Unit

Deprecated: Deprecated in Java.

This function is called by various TestCase implementations, at tearDown() time, in order to scrub out any class variables. This protects against memory leaks in the case where a test case creates a non-static inner class (thus referencing the test case) and gives it to someone else to hold onto.

Parameters
testCaseClass Class<*>!: The class of the derived TestCase implementation.
Exceptions
java.lang.IllegalAccessException

setActivity

Added in API level 1
protected open fun setActivity(testActivity: Activity!): Unit

Deprecated: Deprecated in Java.

Set the activity under test.

Parameters
testActivity Activity!: The activity under test