ITestInvocationListener

public interface ITestInvocationListener
implements ITestLogger, ITestLifeCycleReceiver

com.android.tradefed.result.ITestInvocationListener


Listener for test results from the test invocation.

A test invocation can itself include multiple test runs, so the sequence of calls will be

  • invocationStarted(BuildInfo)
  • testRunStarted
  • testStarted
  • [testFailed]
  • testEnded
  • ...
  • testRunEnded
  • ...
  • testRunStarted
  • ...
  • testRunEnded
  • [invocationFailed]
  • [testLog+]
  • invocationEnded
  • getSummary

Summary

Public methods

default TestSummary getSummary()

Allows the InvocationListener to return a summary.

default void invocationEnded(long elapsedTime)

Reports that the invocation has terminated, whether successfully or due to some error condition.

default void invocationFailed(Throwable cause)

Reports an incomplete invocation due to some error condition.

default void invocationInterrupted()

Called on ICommandScheduler.shutdown(), gives the invocation the opportunity to do something before terminating.

default void invocationStarted(IInvocationContext context)

Reports the start of the test invocation.

default void testModuleEnded()

Reports the end of a module run.

default void testModuleStarted(IInvocationContext moduleContext)

Reports the beginning of a module running.

Public methods

getSummary

public TestSummary getSummary ()

Allows the InvocationListener to return a summary.

Returns
TestSummary A TestSummary summarizing the run, or null

invocationEnded

public void invocationEnded (long elapsedTime)

Reports that the invocation has terminated, whether successfully or due to some error condition.

Will be automatically called by the TradeFederation framework.

Parameters
elapsedTime long: the elapsed time of the invocation in ms

invocationFailed

public void invocationFailed (Throwable cause)

Reports an incomplete invocation due to some error condition.

Will be automatically called by the TradeFederation framework.

Parameters
cause Throwable: the Throwable cause of the failure

invocationInterrupted

public void invocationInterrupted ()

Called on ICommandScheduler.shutdown(), gives the invocation the opportunity to do something before terminating.

invocationStarted

public void invocationStarted (IInvocationContext context)

Reports the start of the test invocation.

Will be automatically called by the TradeFederation framework. Reporters need to override this method to support multiple devices reporting.

Parameters
context IInvocationContext: information about the invocation

testModuleEnded

public void testModuleEnded ()

Reports the end of a module run.

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

Reports the beginning of a module running. This callback is associated with testModuleEnded() and is optional in the sequence. It is only used during a run that uses modules: ITestSuite based runners.

Parameters
moduleContext IInvocationContext: the IInvocationContext of the module.