|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.app.Instrumentation
android.test.InstrumentationTestRunner
public class InstrumentationTestRunner
An Instrumentation that runs various types of TestCases against
an Android package (application). Typical usage:
TestCases that perform unit, functional, or performance tests
against the classes in your package. Typically these are subclassed from:
InstrumentationTestCase.
InstrumentationTestCase (and are not performance tests).
TestCase.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.app.Instrumentation |
|---|
Instrumentation.ActivityMonitor, Instrumentation.ActivityResult |
| Field Summary | |
|---|---|
static String |
ARGUMENT_FUNC_CLASS
|
static String |
ARGUMENT_TEST_CLASS
|
static String |
ARGUMENT_TEST_PACKAGE
|
static String |
ARGUMENT_UNIT_CLASS
|
static String |
REPORT_KEY_NAME_CLASS
If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the name of the current test class. |
static String |
REPORT_KEY_NAME_TEST
If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the name of the current test. |
static String |
REPORT_KEY_NUM_CURRENT
If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the sequence number of the current test. |
static String |
REPORT_KEY_NUM_TOTAL
If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the total number of tests that are being run. |
static String |
REPORT_KEY_STACK
If included in the status bundle sent to an IInstrumentationWatcher, this key identifies a stack trace describing an error or failure. |
static String |
REPORT_VALUE_ID
This value, if stored with key Instrumentation.REPORT_KEY_IDENTIFIER,
identifies InstrumentationTestRunner as the source of the report. |
static int |
REPORT_VALUE_RESULT_ERROR
The test completed with an error. |
static int |
REPORT_VALUE_RESULT_FAILURE
The test completed with a failure. |
static int |
REPORT_VALUE_RESULT_OK
The test completed successfully. |
static int |
REPORT_VALUE_RESULT_START
The test is starting. |
| Fields inherited from class android.app.Instrumentation |
|---|
REPORT_KEY_IDENTIFIER, REPORT_KEY_STREAMRESULT |
| Constructor Summary | |
|---|---|
InstrumentationTestRunner()
|
|
| Method Summary | |
|---|---|
TestSuite |
getAllTests()
Override this to define all of the tests to run in your package. |
protected AndroidTestRunner |
getAndroidTestRunner()
|
ClassLoader |
getLoader()
Override this to provide access to the class loader of your package. |
TestSuite |
getTestSuite()
|
void |
onCreate(Bundle arguments)
Called when the instrumentation is starting, before any application code has been loaded. |
void |
onStart()
Method where the instrumentation thread enters execution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ARGUMENT_TEST_CLASS
public static final String ARGUMENT_UNIT_CLASS
public static final String ARGUMENT_FUNC_CLASS
public static final String ARGUMENT_TEST_PACKAGE
public static final String REPORT_VALUE_ID
Instrumentation.REPORT_KEY_IDENTIFIER,
identifies InstrumentationTestRunner as the source of the report. This is sent with all
status messages.
public static final String REPORT_KEY_NUM_TOTAL
public static final String REPORT_KEY_NUM_CURRENT
public static final String REPORT_KEY_NAME_CLASS
public static final String REPORT_KEY_NAME_TEST
public static final int REPORT_VALUE_RESULT_START
public static final int REPORT_VALUE_RESULT_OK
public static final int REPORT_VALUE_RESULT_ERROR
public static final int REPORT_VALUE_RESULT_FAILURE
public static final String REPORT_KEY_STACK
| Constructor Detail |
|---|
public InstrumentationTestRunner()
| Method Detail |
|---|
public void onCreate(Bundle arguments)
InstrumentationInstrumentation.start() to begin the instrumentation thread, which will then
continue execution in Instrumentation.onStart().
If you do not need your own thread -- that is you are writing your
instrumentation to be completely asynchronous (returning to the event
loop so that the application can run), you can simply begin your
instrumentation here, for example call Context.startActivity(android.content.Intent) to
begin the appropriate first activity of the application.
onCreate in class Instrumentationarguments - Any additional arguments that were supplied when the
instrumentation was started.protected AndroidTestRunner getAndroidTestRunner()
public void onStart()
InstrumentationInstrumentation.sendKeySync(android.view.KeyEvent) or Instrumentation.startActivitySync(android.content.Intent).
You will typically want to call finish() when this function is done, to end your instrumentation.
onStart in class Instrumentationpublic TestSuite getTestSuite()
getTestSuite in interface TestSuiteProviderpublic TestSuite getAllTests()
public ClassLoader getLoader()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||