JarHostTest.HostTestListener

public class JarHostTest.HostTestListener
extends ResultForwarder

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.compatibility.common.tradefed.testtype.JarHostTest.HostTestListener


包裝函式監聽器,會將 testRunStarted() 和 testRunEnded() 以外的所有事件轉送至內嵌監聽器。JAR 中的每個測試類別都會叫用這些事件,而 HostTestListener 會保留這些事件,以供控制台記錄和結果報告使用。

摘要

公用建構函式

HostTestListener(ITestInvocationListener listener)

公用方法

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

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

Reports end of test run.

void testRunStarted(String name, int numTests)

回報測試執行的開始。

公用建構函式

HostTestListener

public HostTestListener (ITestInvocationListener listener)

參數
listener ITestInvocationListener

公用方法

testRunEnded

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

參數
elapsedTime long

metrics Map

testRunEnded

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

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

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

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

testRunStarted

public void testRunStarted (String name, 
                int numTests)

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

參數
name String:測試執行名稱

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