PrettyTestEventLogger

public class PrettyTestEventLogger
extends Object implements ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.testtype.host.PrettyTestEventLogger


記錄器會比對事件並記錄,方便您進行偵錯。主機端和裝置端的記錄檔會嚴格比對,方便您搜尋。

摘要

公用建構函式

PrettyTestEventLogger( devices, boolean methodLevelLogging)

公用方法

void testEnded(TestDescription test, testMetrics)

回報個別測試案例的執行結束時間。

void testFailed(TestDescription test, FailureDescription failure)

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

void testFailed(TestDescription test, String trace)

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

void testRunEnded(long elapsedTimeMillis, runMetrics)

Reports end of test run.

void testRunStarted(String runName, int testCount)

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

void testStarted(TestDescription test)

回報個別測試案例的開始時間。

公用建構函式

PrettyTestEventLogger

public PrettyTestEventLogger ( devices, 
                boolean methodLevelLogging)

參數
devices

methodLevelLogging boolean

公用方法

testEnded

public void testEnded (TestDescription test, 
                 testMetrics)

回報個別測試案例的執行結束時間。

如果未叫用 testFailed(TestDescription, FailureDescription),這項測試就會通過。也會傳回在測試案例執行期間可能發出的任何鍵/值指標。

參數
test TestDescription:識別測試

testMetrics :發出的指標 ERROR(/Map)

testFailed

public void testFailed (TestDescription test, 
                FailureDescription failure)

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

會在 testStarted 和 testEnded 之間呼叫。

參數
test TestDescription:識別測試

failure FailureDescriptionFailureDescription,說明失敗情形和相關情境。

testFailed

public void testFailed (TestDescription test, 
                String trace)

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

會在 testStarted 和 testEnded 之間呼叫。

參數
test TestDescription:識別測試

trace String:失敗的堆疊追蹤

testRunEnded

public void testRunEnded (long elapsedTimeMillis, 
                 runMetrics)

報告測試執行結束時間。

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

runMetrics :在測試執行結束時回報的鍵/值組合

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

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

參數
runName String:測試執行作業名稱

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

testStarted

public void testStarted (TestDescription test)

回報個別測試案例的開始時間。舊版介面,建議盡可能使用 testStarted(com.android.tradefed.result.TestDescription)

參數
test TestDescription:識別測試