Build 1.0_r1(from source)

android.test
Class ActivityInstrumentationTestCase<T extends Activity>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by android.test.InstrumentationTestCase
              extended by android.test.ActivityTestCase
                  extended by android.test.ActivityInstrumentationTestCase<T>
All Implemented Interfaces:
Test

public abstract class ActivityInstrumentationTestCase<T extends Activity>
extends ActivityTestCase

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 ActivityUnitTestCase.


Field Summary
(package private)  Class<T> mActivityClass
           
(package private)  boolean mInitialTouchMode
           
(package private)  String mPackage
           
 
Constructor Summary
ActivityInstrumentationTestCase(String pkg, Class<T> activityClass)
           
ActivityInstrumentationTestCase(String pkg, Class<T> activityClass, boolean initialTouchMode)
           
 
Method Summary
 T getActivity()
           
protected  void setUp()
          Sets up the fixture, for example, open a network connection.
protected  void tearDown()
          Make sure all resources are cleaned up and garbage collected before moving on to the next test.
 void testActivityTestCaseSetUpProperly()
           
 
Methods inherited from class android.test.ActivityTestCase
scrubClass, setActivity
 
Methods inherited from class android.test.InstrumentationTestCase
getInstrumentation, injectInsrumentation, launchActivity, runTest, sendKeys, sendKeys, sendRepeatedKeys
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mPackage

String mPackage

mActivityClass

Class<T extends Activity> mActivityClass

mInitialTouchMode

boolean mInitialTouchMode
Constructor Detail

ActivityInstrumentationTestCase

public ActivityInstrumentationTestCase(String pkg,
                                       Class<T> activityClass)
Parameters:
pkg - The package of the instrumentation.
activityClass - The activity to test.

ActivityInstrumentationTestCase

public ActivityInstrumentationTestCase(String pkg,
                                       Class<T> activityClass,
                                       boolean initialTouchMode)
Parameters:
pkg - The package of the instrumentation.
activityClass - The activity to test.
initialTouchMode - true = in touch mode
Method Detail

getActivity

public T getActivity()
Overrides:
getActivity in class ActivityTestCase
Returns:
Returns the activity under test.

setUp

protected void setUp()
              throws Exception
Description copied from class: TestCase
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.

Overrides:
setUp in class TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Description copied from class: InstrumentationTestCase
Make sure all resources are cleaned up and garbage collected before moving on to the next test. Subclasses that override this method should make sure they call super.tearDown() at the end of the overriding method.

Overrides:
tearDown in class InstrumentationTestCase
Throws:
Exception

testActivityTestCaseSetUpProperly

public void testActivityTestCaseSetUpProperly()
                                       throws Exception
Throws:
Exception

Build 1.0_r1(from source)

Please submit a feedback, bug or feature