public abstract class SingleLaunchActivityTestCase<T extends Activity> extends InstrumentationTestCase
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.Constructor and Description |
---|
SingleLaunchActivityTestCase(String pkg,
Class<T> activityClass)
NOTE: The parameter pkg must refer to the package identifier of the
package hosting the activity to be launched, which is specified in the AndroidManifest.xml
file.
|
Modifier and Type | Method and Description |
---|---|
T |
getActivity() |
protected void |
setUp() |
protected void |
tearDown()
Make sure all resources are cleaned up and garbage collected before moving on to the next
test.
|
void |
testActivityTestCaseSetUpProperly() |
getInstrumentation, injectInsrumentation, injectInstrumentation, launchActivity, launchActivityWithIntent, runTest, runTestOnUiThread, sendKeys, sendKeys, sendRepeatedKeys
public SingleLaunchActivityTestCase(String pkg, Class<T> activityClass)
pkg
- The package hosting the activity to be launched.activityClass
- The activity to test.public T getActivity()
protected void tearDown() throws Exception
InstrumentationTestCase
tearDown
in class InstrumentationTestCase
Exception