InstalledInstrumentationsTest

public class InstalledInstrumentationsTest
extends Object implements IDeviceTest, IResumableTest, IShardableTest, IMetricCollectorReceiver, IInvocationContextReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.InstalledInstrumentationsTest


Runs all instrumentation found on current device.

Summary

Fields

public static final String COVERAGE_TARGET_KEY

the metric key name for the test coverage target value

Public constructors

InstalledInstrumentationsTest()

Public methods

ITestDevice getDevice()

Get the device under test.

boolean isResumable()

void run(ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void setDevice(ITestDevice device)

Inject the device under test.

void setInvocationContext(IInvocationContext invocationContext)

void setMetricCollectors( collectors)

Sets the list of IMetricCollectors defined for the test run.

split(int shardCountHint)

Alternative version of split() which also provides the shardCount that is attempted to be run.

Fields

COVERAGE_TARGET_KEY

public static final String COVERAGE_TARGET_KEY

the metric key name for the test coverage target value

Public constructors

InstalledInstrumentationsTest

public InstalledInstrumentationsTest ()

Public methods

getDevice

public ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

isResumable

public boolean isResumable ()

Returns
boolean

run

public void run (ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
listener ITestInvocationListener: the ITestInvocationListener of test results

Throws
DeviceNotAvailableException

setDevice

public void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device ITestDevice: the ITestDevice to use

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

Parameters
invocationContext IInvocationContext

setMetricCollectors

public void setMetricCollectors ( collectors)

Sets the list of IMetricCollectors defined for the test run.

Parameters
collectors

split

public  split (int shardCountHint)

Alternative version of split() which also provides the shardCount that is attempted to be run. This is useful for some test runner that cannot arbitrarly decide sometimes.

Parameters
shardCountHint int: the attempted shard count.

Returns
a collection of subtests to be executed separately or null if test is not currently shardable