TestRunToTestInvocationForwarder

public class TestRunToTestInvocationForwarder
extends Object implements ITestRunListener

java.lang.Object
   ↳ com.android.tradefed.result.ddmlib.TestRunToTestInvocationForwarder


Forwarder from ddmlib ITestRunListener to ITestLifeCycleReceiver. Interface that ensure the convertion of results from ddmlib interface to Tradefed Interface.

Ddmlib interface is linked to running instrumentation tests.

Summary

Constants

String ERROR_MESSAGE_FORMAT

Public constructors

TestRunToTestInvocationForwarder( listeners)

Public methods

void testAssumptionFailure(TestIdentifier testId, String trace)

Called when an atomic test flags that it assumes a condition that is false

void testEnded(TestIdentifier testId, testMetrics)

Reports the execution end of an individual test case.

void testFailed(TestIdentifier testId, String trace)

Reports the failure of a individual test case.

void testIgnored(TestIdentifier testId)

Called when a test will not be run, generally because a test method is annotated with org.junit.Ignore.

void testRunEnded(long elapsedTime, runMetrics)

Reports end of test run.

void testRunFailed(String failure)

Reports test run failed to complete due to a fatal error.

void testRunStarted(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 testId)

Reports the start of an individual test case.

Constants

ERROR_MESSAGE_FORMAT

public static final String ERROR_MESSAGE_FORMAT

Constant Value: "Runner reported an invalid method '%s' (%s). Something went wrong, Skipping its reporting."

Public constructors

TestRunToTestInvocationForwarder

public TestRunToTestInvocationForwarder ( listeners)

Parameters
listeners

Public methods

testAssumptionFailure

public void testAssumptionFailure (TestIdentifier testId, 
                String trace)

Called when an atomic test flags that it assumes a condition that is false

Parameters
testId TestIdentifier: identifies the test

trace String: stack trace of failure

testEnded

public void testEnded (TestIdentifier testId, 
                 testMetrics)

Reports the execution end of an individual test case.

If testFailed(TestIdentifier, 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
testId TestIdentifier: identifies the test

testMetrics : a ERROR(/Map) of the metrics emitted during the execution of the test case by android.app.Instrumentation#sendStatus. The insertion order is preserved unless you emit a same key multiple times. Note that standard keys defined in IInstrumentationResultParser.StatusKeys are filtered out of this Map. Ddmlib may add extra test metrics defined in IInstrumentationResultParser.StatusKeys.

testFailed

public void testFailed (TestIdentifier testId, 
                String trace)

Reports the failure of a individual test case.

Will be called between testStarted and testEnded.

Parameters
testId TestIdentifier: identifies the test

trace String: stack trace of failure

testIgnored

public void testIgnored (TestIdentifier testId)

Called when a test will not be run, generally because a test method is annotated with org.junit.Ignore.

Parameters
testId TestIdentifier: identifies the test

testRunEnded

public void testRunEnded (long elapsedTime, 
                 runMetrics)

Reports end of test run.

Parameters
elapsedTime long: device reported elapsed time, in milliseconds

runMetrics : a ERROR(/Map) of the metrics emitted during the execution of the test case by android.app.Instrumentation#addResults. The insertion order is preserved unless you emit a same key multiple times. Note that standard keys defined in IInstrumentationResultParser.StatusKeys are filtered out of this Map. Ddmlib may add extra test metrics defined in IInstrumentationResultParser.StatusKeys.

testRunFailed

public void testRunFailed (String failure)

Reports test run failed to complete due to a fatal error.

Parameters
failure String: String describing reason for run failure.

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

Reports the start of a test run.

Parameters
runName String: the test run name

testCount int: total number of tests in test run

testRunStopped

public void testRunStopped (long elapsedTime)

Reports test run stopped before completion due to a user request.

Parameters
elapsedTime long: device reported elapsed time, in milliseconds

testStarted

public void testStarted (TestIdentifier testId)

Reports the start of an individual test case.

Parameters
testId TestIdentifier: identifies the test