分片監聽器

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