ShardMasterResultForwarder

public class ShardMasterResultForwarder
extends LogSaverResultForwarder

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.result.LogSaverResultForwarder
       ↳ com.android.tradefed.invoker.ShardMasterResultForwarder


A ResultForwarder that combines the results of a sharded test invocations. It only reports completion of the invocation to the listeners once all sharded invocations are complete.

This class is not thread safe. It is expected that clients will lock on this class when sending test results, to prevent invocation callbacks from being called out of order.

Summary

Public constructors

ShardMasterResultForwarder(ILogSaver logSaver, List<ITestInvocationListener> listeners, int expectedShards)

Create a ShardMasterResultForwarder.

Public methods

void invocationEnded(long elapsedTime)

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

void invocationFailed(Throwable cause)

Reports an incomplete invocation due to some error condition.

void invocationStarted(IInvocationContext context)

Reports the start of the test invocation.

Public constructors

ShardMasterResultForwarder

ShardMasterResultForwarder (ILogSaver logSaver, 
                List<ITestInvocationListener> listeners, 
                int expectedShards)

Create a ShardMasterResultForwarder.

Parameters
logSaver ILogSaver

listeners List: the list of ITestInvocationListener to forward results to when all shards are completed

expectedShards int: the number of shards

Public methods

invocationEnded

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

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

invocationStarted

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