DeviceTestSuite

public class DeviceTestSuite
extends TestSuite implements IDeviceTest, IRemoteTest

java.lang.Object
   ↳ junit.framework.TestSuite
     ↳ com.android.tradefed.testtype.DeviceTestSuite


Helper JUnit test suite that provides the IRemoteTest and IDeviceTest services.

Summary

Public constructors

DeviceTestSuite(Class<?> testClass)
DeviceTestSuite()

Public methods

void addTestSuite(Class<T> testClass)

Adds the tests from the given class to the suite

ITestDevice getDevice()

Get the device under test.

void run(TestInformation testInfo, ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void runTest(Test test, TestResult result)

Overrides parent method to pass in device to included test

void setDevice(ITestDevice device)

Inject the device under test.

Public constructors

DeviceTestSuite

public DeviceTestSuite (Class<?> testClass)

Parameters
testClass Class

DeviceTestSuite

public DeviceTestSuite ()

Public methods

addTestSuite

public void addTestSuite (Class<T> testClass)

Adds the tests from the given class to the suite

Parameters
testClass Class

getDevice

public ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

run

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
testInfo TestInformation: The TestInformation object containing useful information to run tests.

listener ITestInvocationListener: the ITestInvocationListener of test results

Throws
DeviceNotAvailableException

runTest

public void runTest (Test test, 
                TestResult result)

Overrides parent method to pass in device to included test

Parameters
test Test

result TestResult

setDevice

public void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device ITestDevice: the ITestDevice to use