TestRunToTestInvocationForwarder

public class TestRunToTestInvocationForwarder
extends Object implements ITestRunListener

java.lang.Object
   ↳ com.android.tradefed.result.ddmlib.TestRunToTestInvocationForwarder


從 ddmlib 轉送器 ITestRunListenerITestLifeCycleReceiver。這個介面可確保結果從 ddmlib 介面轉換為 Tradefed 介面。

Ddmlib 介面會連結至執行中的檢測設備測試。

摘要

常數

String ERROR_MESSAGE_FORMAT

公用建構函式

TestRunToTestInvocationForwarder(ITestLifeCycleReceiver listener)
TestRunToTestInvocationForwarder(Collection<ITestLifeCycleReceiver> listeners)

公用方法

void testAssumptionFailure(TestIdentifier testId, String trace)

當原子測試標記假設為 false 的條件時,系統會呼叫這個函式

void testEnded(TestIdentifier testId, Map<String, String> testMetrics)

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

void testFailed(TestIdentifier testId, String trace)

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

void testIgnored(TestIdentifier testId)

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

void testRunEnded(long elapsedTime, Map<String, String> runMetrics)

Reports end of test run.

void testRunFailed(String failure)

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

void testRunStarted(String runName, int testCount)

回報測試執行的開始。

void testRunStopped(long elapsedTime)

由於使用者要求,報表測試執行作業在完成前停止。

void testStarted(TestIdentifier testId)

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

常數

ERROR_MESSAGE_FORMAT

public static final String ERROR_MESSAGE_FORMAT

常數值: 「Runner reported an invalid method '%s' (%s). 發生錯誤,因此系統略過這項作業的報表。」

公用建構函式

TestRunToTestInvocationForwarder

public TestRunToTestInvocationForwarder (ITestLifeCycleReceiver listener)

參數
listener ITestLifeCycleReceiver

TestRunToTestInvocationForwarder

public TestRunToTestInvocationForwarder (Collection<ITestLifeCycleReceiver> listeners)

參數
listeners Collection

公用方法

testAssumptionFailure

public void testAssumptionFailure (TestIdentifier testId, 
                String trace)

當原子測試標記假設為 false 的條件時呼叫

參數
testId TestIdentifier:識別測試

trace String:失敗的堆疊追蹤

testEnded

public void testEnded (TestIdentifier testId, 
                Map<String, String> testMetrics)

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

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

參數
testId TestIdentifier:識別測試

testMetrics Mapandroid.app.Instrumentation#sendStatus 在執行測試案例期間發出的指標 Map。除非您多次發出相同鍵,否則系統會保留插入順序。請注意,系統會從這個 Map 中篩除 IInstrumentationResultParser.StatusKeys 中定義的標準鍵。Ddmlib 可能會新增 IInstrumentationResultParser.StatusKeys 中定義的額外測試指標。

testFailed

public void testFailed (TestIdentifier testId, 
                String trace)

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

會在 testStarted 和 testEnded 之間呼叫。

參數
testId TestIdentifier:識別測試

trace String:失敗的堆疊追蹤

testIgnored

public void testIgnored (TestIdentifier testId)

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

參數
testId TestIdentifier:識別測試

testRunEnded

public void testRunEnded (long elapsedTime, 
                Map<String, String> runMetrics)

測試執行結束時的報告。

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

runMetrics Mapandroid.app.Instrumentation#addResults 在執行測試案例期間發出的指標 Map。除非您多次發出相同鍵,否則系統會保留插入順序。請注意,系統會從這個 Map 中篩除 IInstrumentationResultParser.StatusKeys 中定義的標準鍵。Ddmlib 可能會新增 IInstrumentationResultParser.StatusKeys 中定義的額外測試指標。

testRunFailed

public void testRunFailed (String failure)

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

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

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

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

參數
runName String:測試執行名稱

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

testRunStopped

public void testRunStopped (long elapsedTime)

由於使用者要求,報表測試執行作業在完成前停止。

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

testStarted

public void testStarted (TestIdentifier testId)

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

參數
testId TestIdentifier:識別測試