BugreportzOnFailureCollector

public class BugreportzOnFailureCollector
extends BaseDeviceMetricCollector

java.lang.Object
   ↳ com.android.tradefed.device.metric.BaseDeviceMetricCollector
     ↳ com.android.tradefed.device.metric.BugreportzOnFailureCollector


Collect a bugreportz when a test case fails. If default collection is enabled, it will collect bugreport at the specified levels.

Summary

Public constructors

BugreportzOnFailureCollector()

Public methods

boolean captureModuleLevel()
void onTestEnd(DeviceMetricData testData, Map<String, MetricMeasurement.Metric> currentTestCaseMetrics)

Callback when a test case is ended.

void onTestFail(DeviceMetricData testData, TestDescription test)

Callback when a test case fails.

void onTestModuleEnded()

Allows capturing the module ended event.

void onTestRunEnd(DeviceMetricData runData, Map<String, MetricMeasurement.Metric> currentRunMetrics)

Callback when a test run is ended.

void onTestRunFailed(DeviceMetricData testData, FailureDescription failure)

Callback for testRunFailed events

void onTestRunStart(DeviceMetricData runData)

Callback when a test run is started.

void onTestStart(DeviceMetricData testData)

Callback when a test case is started.

Public constructors

BugreportzOnFailureCollector

public BugreportzOnFailureCollector ()

Public methods

captureModuleLevel

public boolean captureModuleLevel ()

Returns
boolean

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                Map<String, MetricMeasurement.Metric> currentTestCaseMetrics)

Callback when a test case is ended. This should be the time for clean up.

Parameters
testData DeviceMetricData: the DeviceMetricData holding the data for the test case. Will be the same object as during onTestStart(DeviceMetricData).

currentTestCaseMetrics Map: the current map of metrics passed to testEnded(TestDescription,Map).

Throws
DeviceNotAvailableException

onTestFail

public void onTestFail (DeviceMetricData testData, 
                TestDescription test)

Callback when a test case fails.

Parameters
testData DeviceMetricData: the DeviceMetricData holding the data for the test case.

test TestDescription: the TestDescription of the test case in progress.

Throws
DeviceNotAvailableException

onTestModuleEnded

public void onTestModuleEnded ()

Allows capturing the module ended event.

Throws
DeviceNotAvailableException

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                Map<String, MetricMeasurement.Metric> currentRunMetrics)

Callback when a test run is ended. This should be the time for clean up.

Parameters
runData DeviceMetricData: the DeviceMetricData holding the data for the run. Will be the same object as during onTestRunStart(DeviceMetricData).

currentRunMetrics Map: the current map of metrics passed to testRunEnded(long,Map).

Throws
DeviceNotAvailableException

onTestRunFailed

public void onTestRunFailed (DeviceMetricData testData, 
                FailureDescription failure)

Callback for testRunFailed events

onTestRunStart

public void onTestRunStart (DeviceMetricData runData)

Callback when a test run is started.

Parameters
runData DeviceMetricData: the DeviceMetricData holding the data for the run.

Throws
DeviceNotAvailableException

onTestStart

public void onTestStart (DeviceMetricData testData)

Callback when a test case is started.

Parameters
testData DeviceMetricData: the DeviceMetricData holding the data for the test case.

Throws
DeviceNotAvailableException