JUnitToInvocationResultForwarder

public class JUnitToInvocationResultForwarder
extends Object implements TestListener

java.lang.Object
   ↳ com.android.tradefed.result.JUnitToInvocationResultForwarder


監聽 TestListener 事件並將事件轉送至 ITestInvocationListener 的類別。

摘要

公用建構函式

JUnitToInvocationResultForwarder(ITestInvocationListener invocationListener)
JUnitToInvocationResultForwarder( invocationListeners)

公用方法

void addError(Test test, Throwable t)

void addFailure(Test test, AssertionFailedError t)

void endTest(Test test, metrics)

來自 JUnit3 測試的回呼,可轉送指標。

void endTest(Test test)

void startTest(Test test)

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

來自 JUnit3 轉送器的回呼,用於取得測試記錄。

公用建構函式

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder (ITestInvocationListener invocationListener)

參數
invocationListener ITestInvocationListener

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder ( invocationListeners)

參數
invocationListeners

公用方法

addError

public void addError (Test test, 
                Throwable t)

參數
test Test

t Throwable

addFailure

public void addFailure (Test test, 
                AssertionFailedError t)

參數
test Test

t AssertionFailedError

endTest

public void endTest (Test test, 
                 metrics)

可轉送指標的 JUnit3 測試回呼。

參數
test Test:剛執行完畢的 Test

metrics :要傳遞至結果回呼的 Map 格式指標。

endTest

public void endTest (Test test)

參數
test Test

startTest

public void startTest (Test test)

參數
test Test

testLog

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

來自 JUnit3 轉送器的回呼,用於取得測試記錄。

參數
dataName String:資料的字串說明名稱,例如「device_logcat」。請注意,每個叫用作業的 dataName 可能不具唯一性。也就是說,實作者必須能夠處理具有相同 dataName 的多個呼叫

dataType LogDataType:資料的 LogDataType

dataStream InputStreamSource:資料的 InputStreamSource。實作者應呼叫 createInputStream 開始讀取資料,並確保在完成時關閉產生的 InputStream。呼叫端應確保資料來源持續存在,且在 testLog 方法完成前可供存取。