android.test
Class ActivityInstrumentationTestCase<T extends Activity>
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
android.test.InstrumentationTestCase
android.test.ActivityTestCase
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.
| 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 |
mPackage
String mPackage
mActivityClass
Class<T extends Activity> mActivityClass
mInitialTouchMode
boolean mInitialTouchMode
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
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
Please submit a feedback, bug or feature