InstalledInstrumentationsTest

public class InstalledInstrumentationsTest
extends Object implements IDeviceTest, IResumableTest, IShardableTest, IStrictShardableTest

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


Runs all instrumentation found on current device.

Summary

Constants

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.

IRemoteTest getTestShard(int shardCount, int shardIndex)

Returns a IRemoteTest for a single shard.

boolean isResumable()

void run(ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void setDevice(ITestDevice device)

Inject the device under test.

Collection<IRemoteTest> split()

Shard the test into separately runnable chunks.

Constants

COVERAGE_TARGET_KEY

public static final String COVERAGE_TARGET_KEY

the metric key name for the test coverage target value

Constant Value: "coverage_target"

Public constructors

InstalledInstrumentationsTest

public InstalledInstrumentationsTest ()

Public methods

getDevice

public ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

getTestShard

public IRemoteTest getTestShard (int shardCount, 
                int shardIndex)

Returns a IRemoteTest for a single shard. This must be deterministic and always return the same IRemoteTest for the same input.

Parameters
shardCount int: the number of total shards

shardIndex int: the index of a test shard to return. The value is in range [0, shardCount).

Returns
IRemoteTest a IRemoteTest

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

split

public Collection<IRemoteTest> split ()

Shard the test into separately runnable chunks.

This must be deterministic and always return the same list of IRemoteTests for the same input.

This will be called before test execution, so injected dependencies (such as the ITestDevice for IDeviceTests) may be null.

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