GranularRetriableTestWrapper.StartEndCollector

public class GranularRetriableTestWrapper.StartEndCollector
extends ResultAndLogForwarder

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.result.ResultAndLogForwarder
       ↳ com.android.tradefed.testtype.suite.GranularRetriableTestWrapper.StartEndCollector


類別輔助程式,可擷取缺少的跑步開始和結束時間。

摘要

欄位

public TestDescription mCurrentTest

public boolean mRunEndedReported

public boolean mRunStartReported

public boolean mTestInProgress

公用方法

void testEnded(TestDescription test, long endTime, Map<String, String> testMetrics)
void testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)

testEnded(TestDescription,Map) 的替代方案,可直接指定結束時間。

void testEnded(TestDescription test, Map<String, String> testMetrics)
void testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)

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

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

Reports end of test run.

void testRunStarted(String runName, int testCount)

回報測試執行的開始。

void testRunStarted(String runName, int testCount, int attemptNumber, long startTime)

回報測試執行的開始。

void testRunStarted(String runName, int testCount, int attemptNumber)

回報測試執行的開始。

void testStarted(TestDescription test, long startTime)

testStarted(TestDescription) 的替代方案,我們也會指定測試開始時間,並搭配 testEnded(TestDescription,long,Map) 進行準確的評估。

void testStarted(TestDescription test)

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

欄位

mCurrentTest

public TestDescription mCurrentTest

mRunEndedReported

public boolean mRunEndedReported

mRunStartReported

public boolean mRunStartReported

mTestInProgress

public boolean mTestInProgress

公用方法

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                Map<String, String> testMetrics)

參數
test TestDescription

endTime long

testMetrics Map

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

testEnded(TestDescription,Map) 的替代方案,可直接指定結束時間。搭配 testStarted(TestDescription,long) 使用,可準確測量。

參數
test TestDescription:識別測試

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

testMetrics HashMap:發出的指標 Map

testEnded

public void testEnded (TestDescription test, 
                Map<String, String> testMetrics)

參數
test TestDescription

testMetrics Map

testEnded

public void testEnded (TestDescription test, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

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

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

參數
test TestDescription:識別測試

testMetrics HashMap:發出的指標 Map

testRunEnded

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

參數
elapsedTimeMillis long

runMetrics Map

testRunEnded

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

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

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

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

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

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

參數
runName String:測試執行名稱

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

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)

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

參數
runName String:測試執行名稱

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

attemptNumber int:訂單號碼,用於識別多次執行的相同 runName 的不同嘗試。attemptNumber 是以 0 為索引,每次執行新作業時都應遞增。舉例來說,如果測試精細重試 3 次,則在相同 runName 下應有 4 次執行,且 attemptNumber 為 0 到 3。

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

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)

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

參數
runName String:測試執行名稱

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

attemptNumber int:訂單號碼,用於識別多次執行的相同 runName 的不同嘗試。attemptNumber 是以 0 為索引,每次執行新作業時都應遞增。舉例來說,如果測試精細重試 3 次,則在相同 runName 下應有 4 次執行作業,且 attemptNumber 為 0 到 3。

testStarted

public void testStarted (TestDescription test, 
                long startTime)

testStarted(TestDescription) 的替代方案,我們也會指定測試開始時間,並搭配 testEnded(TestDescription,long,Map) 進行準確的評估。

參數
test TestDescription:識別測試

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

testStarted

public void testStarted (TestDescription test)

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

參數
test TestDescription:識別測試