Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public abstract class

ActivityTestCase

extends InstrumentationTestCase
java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ android.test.InstrumentationTestCase
         ↳ android.test.ActivityTestCase
Known Direct Subclasses

Class Overview

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

Summary

Public Constructors
ActivityTestCase ()
Protected Methods
Activity getActivity ()
void )">scrubClass ( Class <?> testCaseClass)
This function is called by various TestCase implementations, at tearDown() time, in order to scrub out any class variables.
void setActivity ( Activity testActivity)
Set the activity under test.
[Expand]
Inherited Methods
From class android.test.InstrumentationTestCase
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface junit.framework.Test

Public Constructors

public ActivityTestCase ()

Added in API level 1

Protected Methods

protected Activity getActivity ()

Added in API level 1

Returns
  • Returns the activity under test.
)">

protected void scrubClass ( Class <?> testCaseClass)

Added in API level 1

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 The class of the derived TestCase implementation.

protected void setActivity ( Activity testActivity)

Added in API level 1

Set the activity under test.

Parameters
testActivity The activity under test