TestsPoolPoller

public class TestsPoolPoller
extends Object implements IRemoteTest, IConfigurationReceiver, IDeviceTest, IBuildReceiver, IMultiDeviceTest, IInvocationContextReceiver, ISystemStatusCheckerReceiver, ITestCollector, IMetricCollectorReceiver

java.lang.Object
   ↳ com.android.tradefed.invoker.shard.TestsPoolPoller


Tests wrapper that allow to execute all the tests of a pool of tests. Tests can be shared by another TestsPoolPoller so synchronization is required.

TODO: Add handling for token module/tests.

Summary

Public constructors

TestsPoolPoller(Collection<IRemoteTest> tests, CountDownLatch tracker)

Ctor where the pool of IRemoteTest is provided.

Public methods

ITestDevice getDevice()

Get the device under test.

void run(ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void setBuild(IBuildInfo buildInfo)
void setCollectTestsOnly(boolean shouldCollectTest)

Enables or disables test collection mode

void setConfiguration(IConfiguration configuration)

Injects the IConfiguration in use.

void setDevice(ITestDevice device)

Inject the device under test.

void setDeviceInfos(Map<ITestDeviceIBuildInfo> deviceInfos)
void setInvocationContext(IInvocationContext invocationContext)
void setMetricCollectors(List<IMetricCollector> collectors)

Sets the list of IMetricCollectors defined for the test run.

void setSystemStatusChecker(List<ISystemStatusChecker> systemCheckers)

Sets the ISystemStatusCheckers from the configuration for the test.

Public constructors

TestsPoolPoller

public TestsPoolPoller (Collection<IRemoteTest> tests, 
                CountDownLatch tracker)

Ctor where the pool of IRemoteTest is provided.

Parameters
tests Collection: IRemoteTests pool of all tests.

tracker CountDownLatch: a CountDownLatch shared to get the number of running poller.

Public methods

getDevice

public ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

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

setBuild

public void setBuild (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

setCollectTestsOnly

public void setCollectTestsOnly (boolean shouldCollectTest)

Enables or disables test collection mode

setConfiguration

public void setConfiguration (IConfiguration configuration)

Injects the IConfiguration in use.

Parameters
configuration IConfiguration

setDevice

public void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device ITestDevice: the ITestDevice to use

setDeviceInfos

public void setDeviceInfos (Map<ITestDeviceIBuildInfo> deviceInfos)

Parameters
deviceInfos Map

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

Parameters
invocationContext IInvocationContext

setMetricCollectors

public void setMetricCollectors (List<IMetricCollector> collectors)

Sets the list of IMetricCollectors defined for the test run.

Parameters
collectors List

setSystemStatusChecker

public void setSystemStatusChecker (List<ISystemStatusChecker> systemCheckers)

Sets the ISystemStatusCheckers from the configuration for the test.

Parameters
systemCheckers List