Android
android.test
public class

android.test.AndroidTestCase

java.lang.Object
junit.framework.Assert
junit.framework.TestCase Test
android.test.AndroidTestCase

Extend this if you need to access Resources or other things that depend on Activity Context.

Summary

Fields

protected      Context  mContext   

Public Constructors

            AndroidTestCase()

Public Methods

          Context  getContext()
          void  setContext(Context context)
          void  testAndroidTestCaseSetupProperly()

Protected Methods

          void  scrubClass(Class<?> testCaseClass)
This function is called by various TestCase implementations, at tearDown() time, in order to scrub out any class variables.
          void  setUp()
Sets up the fixture, for example, open a network connection.
          void  tearDown()
Tears down the fixture, for example, close a network connection.
Methods inherited from class junit.framework.TestCase
Methods inherited from class junit.framework.Assert
Methods inherited from class java.lang.Object
Methods inherited from interface junit.framework.Test

Details

Fields

protected Context mContext

Public Constructors

public AndroidTestCase()

Public Methods

public Context getContext()

public void setContext(Context context)

public void testAndroidTestCaseSetupProperly()

Protected Methods

protected void scrubClass(Class<?> testCaseClass)

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 setUp()

Sets up the fixture, for example, open a network connection. This method is called before a test is executed.

Throws

Exception

protected void tearDown()

Tears down the fixture, for example, close a network connection. This method is called after a test is executed.

Throws

Exception
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56