JUnitToInvocationResultForwarder
public class JUnitToInvocationResultForwarder
extends Object
implements TestListener
java.lang.Object |
↳ | com.android.tradefed.result.JUnitToInvocationResultForwarder |
偵聽TestListener
事件並將它們轉發到ITestInvocationListener
類。
概括
公共構造函數
JUnitToInvocationResultForwarder
public JUnitToInvocationResultForwarder (ITestInvocationListener invocationListener)
參數 |
---|
invocationListener | ITestInvocationListener |
JUnitToInvocationResultForwarder
public JUnitToInvocationResultForwarder ( invocationListeners)
公共方法
添加錯誤
public void addError (Test test,
Throwable t)
添加失敗
public void addFailure (Test test,
AssertionFailedError t)
參數 |
---|
test | Test |
t | AssertionFailedError |
結束測試
public void endTest (Test test,
metrics)
來自可以轉髮指標的 JUnit3 測試的回調。
參數 |
---|
test | Test :剛運行完的Test 。 |
metrics | :要傳遞給結果回調的 Map 格式的指標。 |
結束測試
public void endTest (Test test)
開始測試
public void startTest (Test test)
public void testLog (String dataName,
LogDataType dataType,
InputStreamSource dataStream)
從 JUnit3 轉發器回調,以便從測試中獲取日誌。
參數 |
---|
dataName | String :數據的 String 描述性名稱。例如“device_logcat”。注意 dataName 每次調用可能不是唯一的。即實現者必須能夠處理具有相同數據名的多個調用 |
dataType | LogDataType :數據的 LogDataType |
dataStream | InputStreamSource :數據的 InputStreamSource。實施者應調用 createInputStream 開始讀取數據,並確保在完成後關閉生成的 InputStream。調用者應確保數據源保持存在且可訪問,直到 testLog 方法完成。 |