FilteredResultForwarder

public class FilteredResultForwarder
extends ResultForwarder

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.result.FilteredResultForwarder


ResultForwarder 的變化版本,僅允許回報 TestDescription 的許可清單。

摘要

公用建構函式

FilteredResultForwarder( allowedTests, ITestInvocationListener... listeners)

公用方法

void testAssumptionFailure(TestDescription test, FailureDescription failure)

當原子測試標記假設條件為 false 時,系統會呼叫此方法

void testAssumptionFailure(TestDescription test, String trace)

當原子測試標記假設條件為 false 時,系統會呼叫此方法

void testEnded(TestDescription test, testMetrics)

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

void testEnded(TestDescription test, long endTime, testMetrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)) 的替代方案,可直接指定結束時間。

void testFailed(TestDescription test, FailureDescription failure)

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

void testFailed(TestDescription test, String trace)

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

void testIgnored(TestDescription test)

當測試不會執行時,系統會呼叫此方法,通常是因為測試方法已標記為 org.junit.Ignore。

void testStarted(TestDescription test, long startTime)

testStarted(com.android.tradefed.result.TestDescription) 的替代方案,我們也會指定測試開始時間,並搭配 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) 進行精確評估。

void testStarted(TestDescription test)

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

公用建構函式

FilteredResultForwarder

public FilteredResultForwarder ( allowedTests, 
                ITestInvocationListener... listeners)

參數
allowedTests

listeners ITestInvocationListener

公用方法

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

當原子測試標記假設條件為 false 時,系統會呼叫此方法

參數
test TestDescription:用於識別測試

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

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                String trace)

當原子測試標記假設條件為 false 時,系統會呼叫此方法

參數
test TestDescription:用於識別測試

trace String:失敗的堆疊追蹤

testEnded

public void testEnded (TestDescription test, 
                 testMetrics)

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

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

參數
test TestDescription:用於識別測試

testMetrics :傳送指標的 ERROR(/Map)

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                 testMetrics)

ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)) 的替代方案,可直接指定結束時間。搭配使用 testStarted(com.android.tradefed.result.TestDescription, long) 可獲得準確的測量結果。

參數
test TestDescription:用於識別測試

endTime long:測試結束的時間,透過 System.currentTimeMillis() 測量

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:失敗的堆疊追蹤

testIgnored

public void testIgnored (TestDescription test)

當測試不會執行時,系統會呼叫此方法,通常是因為測試方法已標註為 org.junit.Ignore。

參數
test TestDescription:用於識別測試

testStarted

public void testStarted (TestDescription test, 
                long startTime)

testStarted(com.android.tradefed.result.TestDescription) 的替代方案,我們也會指定測試開始時間,並搭配 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) 進行精確評估。

參數
test TestDescription:用於識別測試

startTime long:測試開始的時間,透過 System.currentTimeMillis() 測量

testStarted

public void testStarted (TestDescription test)

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

參數
test TestDescription:用於識別測試