ShardMainResultForwarder

public class ShardMainResultForwarder
extends ResultForwarder implements ILogSaverListener

java.lang.Object
com.android.tradefed.result.ResultForwarder
com.android.tradefed.invoker.ShardMainResultForwarder


合并分片测试调用结果的ResultForwarder 。它仅在所有分片调用完成后才向侦听器报告调用完成情况。

该类不是线程安全的。预计客户端在发送测试结果时会锁定此类,以防止乱序调用调用回调。

概括

公共构造函数

ShardMainResultForwarder ( listeners, int expectedShards) ShardMainResultForwarder ( listeners, int expectedShards)

创建一个ShardMainResultForwarder

公共方法

void invocationEnded (long elapsedTime)

void invocationEnded (long elapsedTime, IInvocationContext context)

更详细的回调以区分哪个分片已完成。

void invocationFailed (FailureDescription failure)

void invocationFailed (Throwable cause)

void invocationStarted (IInvocationContext context)

void logAssociation (String dataName, LogFile logFile)

void testLogForward (String dataName, LogDataType dataType, InputStreamSource dataStream)

只转发testLog,而不是先保存log。

void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)

公共构造函数

ShardMainResultForwarder

public ShardMainResultForwarder ( listeners, 
                int expectedShards)

创建一个ShardMainResultForwarder

参数
listeners :当所有分片完成时将结果转发到的ITestInvocationListener列表

expectedShards int : 分片数量

公共方法

调用结束

public void invocationEnded (long elapsedTime)

参数
elapsedTime long

调用结束

public void invocationEnded (long elapsedTime, 
                IInvocationContext context)

更详细的回调以区分哪个分片已完成。

参数
elapsedTime long

context IInvocationContext

调用失败

public void invocationFailed (FailureDescription failure)

参数
failure FailureDescription

调用失败

public void invocationFailed (Throwable cause)

参数
cause Throwable

调用开始

public void invocationStarted (IInvocationContext context)

参数
context IInvocationContext

日志关联

public void logAssociation (String dataName, 
                LogFile logFile)

参数
dataName String

logFile LogFile

测试日志转发

public void testLogForward (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

只转发testLog,而不是先保存log。

参数
dataName String

dataType LogDataType

dataStream InputStreamSource

测试日志已保存

public void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream, 
                LogFile logFile)

参数
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile