分片监听器

public class ShardListener
extends CollectingTestListener implements ISupportGranularResults

java.lang.Object
com.android.tradefed.result.CollectingTestListener
com.android.tradefed.invoker.ShardListener


一个ITestInvocationListener ,用于从调用分片(也称为在多个资源上并行运行的调用拆分)收集结果,并将它们转发到另一个侦听器。

概括

公共构造函数

ShardListener (ITestInvocationListener main)

创建一个ShardListener

公共方法

void invocationEnded (long elapsedTime)

void invocationFailed (FailureDescription failure)

void invocationFailed (Throwable cause)

void invocationStarted (IInvocationContext context)

void setSupportGranularResults (boolean enableGranularResults)
boolean supportGranularResults ()

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

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

void testModuleEnded ()

void testModuleStarted (IInvocationContext moduleContext)

void testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics)

void testRunFailed (FailureDescription failure)

void testRunFailed (String failureMessage)

void testRunStarted (String name, int numTests, int attemptNumber, long startTime)

公共构造函数

分片监听器

public ShardListener (ITestInvocationListener main)

创建一个ShardListener

参数
main ITestInvocationListener :应该转发结果的ITestInvocationListener 。为了防止与其他ShardListener发生冲突,该对象在转发结果时将在main上同步。并且只有在调用分片完成后才会发送结果。

公共方法

调用结束

public void invocationEnded (long elapsedTime)

参数
elapsedTime long

调用失败

public void invocationFailed (FailureDescription failure)

参数
failure FailureDescription

调用失败

public void invocationFailed (Throwable cause)

参数
cause Throwable

调用开始

public void invocationStarted (IInvocationContext context)

参数
context IInvocationContext

设置支持粒度结果

public void setSupportGranularResults (boolean enableGranularResults)

参数
enableGranularResults boolean

支持粒度结果

public boolean supportGranularResults ()

退货
boolean

测试日志

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

参数
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

测试模块结束

public void testModuleEnded ()

测试模块启动

public void testModuleStarted (IInvocationContext moduleContext)

参数
moduleContext IInvocationContext

测试运行结束

public void testRunEnded (long elapsedTime, 
                 runMetrics)

参数
elapsedTime long

runMetrics

测试运行失败

public void testRunFailed (FailureDescription failure)

参数
failure FailureDescription

测试运行失败

public void testRunFailed (String failureMessage)

参数
failureMessage String

测试运行开始

public void testRunStarted (String name, 
                int numTests, 
                int attemptNumber, 
                long startTime)

参数
name String

numTests int

attemptNumber int

startTime long