ModuleDefinition

public class ModuleDefinition
extends Object implements Comparable<ModuleDefinition>, ITestCollector

java.lang.Object
   ↳ com.android.tradefed.testtype.suite.ModuleDefinition


Container for the test run configuration. This class is an helper to prepare and run the tests.

Summary

Constants

String MODULE_INCOMPLETE_MSG

Public constructors

ModuleDefinition(String name, List<IRemoteTest> tests, List<ITargetPreparer> preparers)

Constructor

Public methods

int compareTo(ModuleDefinition moduleDef)

String getId()

Return the unique module name.

boolean hasModuleFailed()

Returns True if a testRunFailure has been called on the module *

void run(ITestInvocationListener listener)

Run all the IRemoteTest contained in the module and use all the preparers before and after to setup and clean the device.

void run(ITestInvocationListener listener, TestFailureListener failureListener)

Run all the IRemoteTest contained in the module and use all the preparers before and after to setup and clean the device.

void setBuild(IBuildInfo build)

Inject the IBuildInfo to be used during the tests.

void setCollectTestsOnly(boolean collectTestsOnly)

Enables or disables test collection mode

void setDevice(ITestDevice device)

Inject the ITestDevice to be used during the tests.

String toString()

Constants

MODULE_INCOMPLETE_MSG

String MODULE_INCOMPLETE_MSG

Constant Value: "Module did not run all its tests."

Public constructors

ModuleDefinition

ModuleDefinition (String name, 
                List<IRemoteTest> tests, 
                List<ITargetPreparer> preparers)

Constructor

Parameters
name String: unique name of the test configuration.
tests List: list of IRemoteTest that needs to run.
preparers List: list of ITargetPreparer to be used to setup the device.

Public methods

compareTo

int compareTo (ModuleDefinition moduleDef)

Parameters
moduleDef ModuleDefinition
Returns
int

getId

String getId ()

Return the unique module name.

Returns
String

hasModuleFailed

boolean hasModuleFailed ()

Returns True if a testRunFailure has been called on the module *

Returns
boolean

run

void run (ITestInvocationListener listener)

Run all the IRemoteTest contained in the module and use all the preparers before and after to setup and clean the device.

Parameters
listener ITestInvocationListener: the ITestInvocationListener where to report results.
Throws
DeviceNotAvailableException in case of device going offline.

run

void run (ITestInvocationListener listener, 
                TestFailureListener failureListener)

Run all the IRemoteTest contained in the module and use all the preparers before and after to setup and clean the device.

Parameters
listener ITestInvocationListener: the ITestInvocationListener where to report results.
failureListener TestFailureListener: a particular listener to collect logs on testFail. Can be null.
Throws
DeviceNotAvailableException in case of device going offline.

setBuild

void setBuild (IBuildInfo build)

Inject the IBuildInfo to be used during the tests.

Parameters
build IBuildInfo

setCollectTestsOnly

void setCollectTestsOnly (boolean collectTestsOnly)

Enables or disables test collection mode

setDevice

void setDevice (ITestDevice device)

Inject the ITestDevice to be used during the tests.

Parameters
device ITestDevice

toString

String toString ()

Returns
String