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 sẽ lấy các phép đo mức độ sử dụng Java trên thiết bị và ghi lại dưới dạng cấu phần phần mềm kiểm thử.

Tóm tắt

Trường

public static final String COVERAGE_DIRECTORY

public static final String COVERAGE_MEASUREMENT_KEY

public static final String FIND_COVERAGE_FILES

Hàm khởi tạo công khai

JavaCodeCoverageCollector()

Phương thức công khai

ITestInvocationListener init(IInvocationContext context, ITestInvocationListener listener)

Khởi chạy trình thu thập dữ liệu bằng ngữ cảnh hiện tại và nơi chuyển tiếp kết quả.

void onTestRunEnd(DeviceMetricData runData, runMetrics)

Lệnh gọi lại khi một lần chạy kiểm thử kết thúc.

void setConfiguration(IConfiguration configuration)

Chèn IConfiguration đang sử dụng.

void setCoverageFlusher(JavaCodeCoverageFlusher flusher)
void setMergeMeasurements(boolean merge)

Trường

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

Hàm khởi tạo công khai

JavaCodeCoverageCollector

public JavaCodeCoverageCollector ()

Phương thức công khai

khởi tạo

public ITestInvocationListener init (IInvocationContext context, 
                ITestInvocationListener listener)

Khởi chạy trình thu thập dữ liệu bằng ngữ cảnh hiện tại và nơi chuyển tiếp kết quả. Sẽ chỉ được gọi một lần cho mỗi thực thể và trình thu thập dữ liệu dự kiến sẽ cập nhật ngữ cảnh và trình nghe nội bộ. Init sẽ không bao giờ được gọi trong quá trình chạy kiểm thử.

Đừng ghi đè trừ phi bạn biết mình đang làm gì.

Tham số
context IInvocationContext: IInvocationContext cho lệnh gọi đang diễn ra.

listener ITestInvocationListener: ITestInvocationListener nơi đặt kết quả.

Giá trị trả về
ITestInvocationListener trình nghe mới bao bọc trình nghe ban đầu.

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                 runMetrics)

Lệnh gọi lại khi một lần chạy kiểm thử kết thúc. Đây là lúc dọn dẹp.

Tham số
runData DeviceMetricData: DeviceMetricData lưu giữ dữ liệu cho lần chạy. Sẽ là đối tượng giống như trong BaseDeviceMetricCollector.onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData).

runMetrics : bản đồ hiện tại của các chỉ số được truyền đến ITestLifeCycleReceiver.testRunEnded(long, Map).

setConfiguration

public void setConfiguration (IConfiguration configuration)

Chèn IConfiguration đang sử dụng.

Tham số
configuration IConfiguration

setCoverageFlusher

public void setCoverageFlusher (JavaCodeCoverageFlusher flusher)

Tham số
flusher JavaCodeCoverageFlusher

setMergeMeasurements

public void setMergeMeasurements (boolean merge)

Tham số
merge boolean