TestRunResultListener

public final class TestRunResultListener
extends Object implements ITestInvocationListener

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


可讀取最終測試執行狀態的接聽程式。

摘要

公用建構函式

TestRunResultListener()

公用方法

boolean isTestFailed(String testName)
boolean isTestRunFailed(String testRunName)
void testFailed(TestDescription test, FailureDescription failure)

回報個別測試案例的失敗情形。

void testFailed(TestDescription test, String trace)

回報個別測試案例的失敗情形。

void testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)

Reports end of test run.

void testRunFailed(FailureDescription failure)

由於 FailureDescription 所述的錯誤,報表測試執行作業無法完成。

void testRunFailed(String errorMessage)

發生嚴重錯誤,因此無法完成報表測試執行。

void testRunStarted(String runName, int testCount)

回報測試執行的開始。

公用建構函式

TestRunResultListener

public TestRunResultListener ()

公用方法

isTestFailed

public boolean isTestFailed (String testName)

參數
testName String

傳回
boolean

isTestRunFailed

public boolean isTestRunFailed (String testRunName)

參數
testRunName String

傳回
boolean

testFailed

public void testFailed (TestDescription test, 
                FailureDescription failure)

回報個別測試案例的失敗情形。

會在 testStarted 和 testEnded 之間呼叫。

參數
test TestDescription:識別測試

failure FailureDescription:說明失敗情形和相關情境的 FailureDescription

testFailed

public void testFailed (TestDescription test, 
                String trace)

回報個別測試案例的失敗情形。

會在 testStarted 和 testEnded 之間呼叫。

參數
test TestDescription:識別測試

trace String:失敗的堆疊追蹤

testRunEnded

public void testRunEnded (long elapsedTime, 
                HashMap<String, MetricMeasurement.Metric> runMetrics)

測試執行結束時會回報。FIXME:我們無法使用不同型別的兩個 Map<> 介面,因此必須在此使用 HashMap。

參數
elapsedTime long:裝置回報的經過時間 (以毫秒為單位)

runMetrics HashMap:在測試執行結束時,使用 Metric 報告的鍵/值組合。

testRunFailed

public void testRunFailed (FailureDescription failure)

由於 FailureDescription 所述的錯誤,報表測試執行作業無法完成。

參數
failure FailureDescription:說明失敗情形和相關情境的 FailureDescription

testRunFailed

public void testRunFailed (String errorMessage)

發生嚴重錯誤,因此無法完成報表測試執行作業。

參數
errorMessage StringString,說明執行失敗的原因。

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

回報測試執行的開始時間。

參數
runName String:測試執行名稱

testCount int:測試執行作業中的測試總數