ITestSuite

public abstract class ITestSuite
extends Object implements IRemoteTest, IDeviceTest, IBuildReceiver, ISystemStatusCheckerReceiver, IShardableTest, ITestCollector, IInvocationContextReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.suite.ITestSuite
Known Direct Subclasses
TfSuiteRunner Implementation of ITestSuite which will load tests from TF jars res/config/suite/ folder. 


Abstract class used to run Test Suite. This class provide the base of how the Suite will be run. Each implementation can define the list of tests via the loadTests() method.

Summary

Constants

String MODULE_CHECKER_POST

String MODULE_CHECKER_PRE

Public constructors

ITestSuite()

Public methods

IBuildInfo getBuildInfo()

Implementation of ITestSuite may require the build info to load the tests.

ITestDevice getDevice()

Get the device under test.

abstract LinkedHashMap<String, IConfiguration> loadTests()

Abstract method to load the tests configuration that will be run.

final void run(ITestInvocationListener listener)

Generic run method for all test loaded from loadTests().

void setBuild(IBuildInfo buildInfo)

void setCollectTestsOnly(boolean shouldCollectTest)

Run the test suite in collector only mode, this requires all the sub-tests to implements this interface too.

void setDevice(ITestDevice device)

Inject the device under test.

void setInvocationContext(IInvocationContext invocationContext)

void setShouldMakeDynamicModule(boolean dynamicModule)

When doing distributed sharding, we cannot have ModuleDefinition that shares tests in a pool otherwise intra-module sharding will not work, so we allow to disable it.

void setSystemStatusChecker(List<ISystemStatusChecker> systemCheckers)

Sets the ISystemStatusCheckers from the configuration for the test.

Collection<IRemoteTest> split(int shardCountHint)

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

Constants

MODULE_CHECKER_POST

String MODULE_CHECKER_POST

Constant Value: "PostModuleChecker"

MODULE_CHECKER_PRE

String MODULE_CHECKER_PRE

Constant Value: "PreModuleChecker"

Public constructors

ITestSuite

ITestSuite ()

Public methods

getBuildInfo

IBuildInfo getBuildInfo ()

Implementation of ITestSuite may require the build info to load the tests.

Returns
IBuildInfo

getDevice

ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

loadTests

LinkedHashMap<String, IConfiguration> loadTests ()

Abstract method to load the tests configuration that will be run. Each tests is defined by a IConfiguration and a unique name under which it will report results.

Returns
LinkedHashMap<String, IConfiguration>

run

void run (ITestInvocationListener listener)

Generic run method for all test loaded from loadTests().

Parameters
listener ITestInvocationListener: the ITestInvocationListener of test results

Throws
DeviceNotAvailableException

setBuild

void setBuild (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

setCollectTestsOnly

void setCollectTestsOnly (boolean shouldCollectTest)

Run the test suite in collector only mode, this requires all the sub-tests to implements this interface too.

setDevice

void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device ITestDevice: the ITestDevice to use

setInvocationContext

void setInvocationContext (IInvocationContext invocationContext)

Parameters
invocationContext IInvocationContext

setShouldMakeDynamicModule

void setShouldMakeDynamicModule (boolean dynamicModule)

When doing distributed sharding, we cannot have ModuleDefinition that shares tests in a pool otherwise intra-module sharding will not work, so we allow to disable it.

Parameters
dynamicModule boolean

setSystemStatusChecker

void setSystemStatusChecker (List<ISystemStatusChecker> systemCheckers)

Sets the ISystemStatusCheckers from the configuration for the test.

Parameters
systemCheckers List

split

Collection<IRemoteTest> 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
Collection<IRemoteTest> a collection of subtests to be executed separately or null if test is not currently shardable