JavaCodeCoverageCollector

public final class JavaCodeCoverageCollector
extends BaseDeviceMetricCollector implements IConfigurationReceiver

java.lang.Object
com.android.tradefed.device.metric.BaseDeviceMetricCollector
com.android.tradefed.device.metric.JavaCodeCoverageCollector


一個BaseDeviceMetricCollector ,它將從設備中提取 Java 覆蓋率測量並將它們記錄為測試工件。

概括

字段

public static final String COMPRESS_COVERAGE_FILES

public static final String COVERAGE_DIRECTORY

public static final String COVERAGE_MEASUREMENT_KEY

public static final String FIND_COVERAGE_FILES

public static final String MERGE_COVERAGE_MEASUREMENTS_TEST_NAME

公共構造函數

JavaCodeCoverageCollector ()

公共方法

ITestInvocationListener init ( IInvocationContext context, ITestInvocationListener listener)

使用當前上下文和轉發結果的位置初始化收集器。

void onTestRunEnd ( DeviceMetricData runData, runMetrics) onTestRunEnd ( DeviceMetricData runData, runMetrics)

測試運行結束時的回調。

void setConfiguration ( IConfiguration configuration)

注入正在使用的IConfiguration

字段

COMPRESS_COVERAGE_FILES

public static final String COMPRESS_COVERAGE_FILES

COVERAGE_DIRECTORY

public static final String COVERAGE_DIRECTORY

COVERAGE_MEASUREMENT_KEY

public static final String COVERAGE_MEASUREMENT_KEY

FIND_COVERAGE_FILES

public static final String FIND_COVERAGE_FILES

MERGE_COVERAGE_MEASUREMENTS_TEST_NAME

public static final String MERGE_COVERAGE_MEASUREMENTS_TEST_NAME

公共構造函數

JavaCodeCoverageCollector

public JavaCodeCoverageCollector ()

公共方法

在裡面

public ITestInvocationListener init (IInvocationContext context, 
                ITestInvocationListener listener)

使用當前上下文和轉發結果的位置初始化收集器。每個實例只會被調用一次,並且收集器應該更新其內部上下文和偵聽器。在測試運行期間永遠不會調用 Init。

除非您知道自己在做什麼,否則不要覆蓋。

參數
context IInvocationContext :正在進行的調用的IInvocationContext

listener ITestInvocationListener :放置結果的ITestInvocationListener

退貨
ITestInvocationListener新的監聽器包裝了原來的監聽器。

投擲
DeviceNotAvailableException

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                 runMetrics)

測試運行結束時的回調。這應該是清理的時候了。

參數
runData DeviceMetricData :保存運行數據的DeviceMetricData 。將與BaseDeviceMetricCollector.onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData)期間的對象相同。

runMetrics : 傳遞給ERROR(/#testRunEnded(long,Map))的指標的當前映射。

投擲
DeviceNotAvailableException

設置配置

public void setConfiguration (IConfiguration configuration)

注入正在使用的IConfiguration

參數
configuration IConfiguration