com.android.ddmlib.testrunner
Interface ITestRunListener

All Known Implementing Classes:
XmlTestRunListener

public interface ITestRunListener

Receives event notifications during instrumentation test runs.

Patterned after junit.runner.TestRunListener.

The sequence of calls will be:


Nested Class Summary
static class ITestRunListener.TestFailure
          Types of test failures.
 
Method Summary
 void testEnded(TestIdentifier test, java.util.Map<java.lang.String,java.lang.String> testMetrics)
          Reports the execution end of an individual test case.
 void testFailed(ITestRunListener.TestFailure status, TestIdentifier test, java.lang.String trace)
          Reports the failure of a individual test case.
 void testRunEnded(long elapsedTime, java.util.Map<java.lang.String,java.lang.String> runMetrics)
          Reports end of test run.
 void testRunFailed(java.lang.String errorMessage)
          Reports test run failed to complete due to a fatal error.
 void testRunStarted(java.lang.String runName, int testCount)
          Reports the start of a test run.
 void testRunStopped(long elapsedTime)
          Reports test run stopped before completion due to a user request.
 void testStarted(TestIdentifier test)
          Reports the start of an individual test case.
 

Method Detail

testRunStarted

void testRunStarted(java.lang.String runName,
                    int testCount)
Reports the start of a test run.

Parameters:
runName - the test run name
testCount - total number of tests in test run

testStarted

void testStarted(TestIdentifier test)
Reports the start of an individual test case.

Parameters:
test - identifies the test

testFailed

void testFailed(ITestRunListener.TestFailure status,
                TestIdentifier test,
                java.lang.String trace)
Reports the failure of a individual test case.

Will be called between testStarted and testEnded.

Parameters:
status - failure type
test - identifies the test
trace - stack trace of failure

testEnded

void testEnded(TestIdentifier test,
               java.util.Map<java.lang.String,java.lang.String> testMetrics)
Reports the execution end of an individual test case.

If testFailed(com.android.ddmlib.testrunner.ITestRunListener.TestFailure, com.android.ddmlib.testrunner.TestIdentifier, java.lang.String) was not invoked, this test passed. Also returns any key/value metrics which may have been emitted during the test case's execution.

Parameters:
test - identifies the test
testMetrics - a Map of the metrics emitted

testRunFailed

void testRunFailed(java.lang.String errorMessage)
Reports test run failed to complete due to a fatal error.

Parameters:
errorMessage - String describing reason for run failure.

testRunStopped

void testRunStopped(long elapsedTime)
Reports test run stopped before completion due to a user request.

TODO: currently unused, consider removing

Parameters:
elapsedTime - device reported elapsed time, in milliseconds

testRunEnded

void testRunEnded(long elapsedTime,
                  java.util.Map<java.lang.String,java.lang.String> runMetrics)
Reports end of test run.

Parameters:
elapsedTime - device reported elapsed time, in milliseconds
runMetrics - key-value pairs reported at the end of a test run