DeviceJUnit4ClassRunner

public class DeviceJUnit4ClassRunner
extends BlockJUnit4ClassRunner implements IDeviceTest, IBuildReceiver, IAbiReceiver

java.lang.Object
   ↳ org.junit.runner.Runner
     ↳ org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
       ↳ org.junit.runners.BlockJUnit4ClassRunner
         ↳ com.android.tradefed.testtype.DeviceJUnit4ClassRunner


JUnit4 test runner that also accommodate IDeviceTest. Should be specify above JUnit4 Test with the RunWith annotation.

Summary

Public constructors

DeviceJUnit4ClassRunner(Class<?> klass)

Public methods

ITestDevice getDevice()

Get the device under test.

void setAbi(IAbi abi)
void setBuild(IBuildInfo buildInfo)
void setDevice(ITestDevice device)

Inject the device under test.

Protected methods

Object createTest()

We override createTest in order to set the device.

Public constructors

DeviceJUnit4ClassRunner

DeviceJUnit4ClassRunner (Class<?> klass)

Parameters
klass Class
Throws
InitializationError

Public methods

getDevice

ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

setAbi

void setAbi (IAbi abi)

Parameters
abi IAbi

setBuild

void setBuild (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

setDevice

void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device ITestDevice: the ITestDevice to use

Protected methods

createTest

Object createTest ()

We override createTest in order to set the device.

Returns
Object
Throws
Exception