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,
回報測試執行結束。 |
void
|
testRunFailed(FailureDescription failure)
由於 |
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,runMetrics)
回報測試執行結束。
參數 | |
---|---|
elapsedTime |
long :裝置回報的經過時間,以毫秒為單位 |
runMetrics |
:測試執行結束時回報的鍵/值組合 |
testRunFailed
public void testRunFailed (FailureDescription failure)
由於 FailureDescription
所述的錯誤,導致報表測試執行作業無法完成。
參數 | |
---|---|
failure |
FailureDescription :FailureDescription 可說明失敗和相關情境。 |
testRunFailed
public void testRunFailed (String errorMessage)
由於發生致命錯誤,因此無法完成報表測試執行作業。
參數 | |
---|---|
errorMessage |
String :String ,說明執行失敗的原因。 |
testRunStarted
public void testRunStarted (String runName, int testCount)
回報測試執行作業的開始時間。
參數 | |
---|---|
runName |
String :測試執行作業名稱 |
testCount |
int :測試執行作業中的測試總數 |