Build 1.0_r1(from source)

android.test
Class SingleLaunchActivityTestCase<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.SingleLaunchActivityTestCase<T>
All Implemented Interfaces:
Test

public abstract class SingleLaunchActivityTestCase<T extends Activity>
extends InstrumentationTestCase

If you would like to test a single activity with an 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.


Field Summary
(package private)  Class<T> mActivityClass
           
(package private)  String mPackage
           
 
Constructor Summary
SingleLaunchActivityTestCase(String pkg, Class<T> activityClass)
           
 
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.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
Constructor Detail

SingleLaunchActivityTestCase

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

getActivity

public T getActivity()

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