MoblyBinaryHostTest

public class MoblyBinaryHostTest
extends Object implements IRemoteTest, IDeviceTest, IBuildReceiver, ITestFilterReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.mobly.MoblyBinaryHostTest


Host test meant to run a mobly python binary file from the Android Build system (Soong)

Summary

Public constructors

MoblyBinaryHostTest()

Public methods

void addAllExcludeFilters( filters)

Adds the ERROR(/Set) of filters of which tests to exclude.

void addAllIncludeFilters( filters)

Adds the ERROR(/Set) of filters of which tests to include.

void addExcludeFilter(String filter)

Adds a filter of which tests to exclude.

void addIncludeFilter(String filter)

Adds a filter of which tests to include.

void clearExcludeFilters()

Delete all the exclude filters currently tracked.

void clearIncludeFilters()

Delete all the include filters currently tracked.

ITestDevice getDevice()

Get the device under test.

getExcludeFilters()

Returns the current ERROR(/Set) of exclude filters.

getIncludeFilters()

Returns the current ERROR(/Set) of include filters.

final void run(TestInformation testInfo, ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void setBuild(IBuildInfo buildInfo)
void setDevice(ITestDevice device)

Inject the device under test.

Protected methods

String[] buildCommandLineArray(String filePath, String configPath)
void processYamlTestResults(InputStream inputStream, MoblyYamlResultParser parser, ITestInvocationListener listener, String runName)

Parses Mobly test results and does result reporting.

void reportLogs(File logDir, ITestInvocationListener listener)
void updateConfigFile(InputStream configInputStream, Writer writer)

Public constructors

MoblyBinaryHostTest

public MoblyBinaryHostTest ()

Public methods

addAllExcludeFilters

public void addAllExcludeFilters ( filters)

Adds the ERROR(/Set) of filters of which tests to exclude.

Parameters
filters

addAllIncludeFilters

public void addAllIncludeFilters ( filters)

Adds the ERROR(/Set) of filters of which tests to include.

Parameters
filters

addExcludeFilter

public void addExcludeFilter (String filter)

Adds a filter of which tests to exclude.

Parameters
filter String

addIncludeFilter

public void addIncludeFilter (String filter)

Adds a filter of which tests to include.

Parameters
filter String

clearExcludeFilters

public void clearExcludeFilters ()

Delete all the exclude filters currently tracked.

clearIncludeFilters

public void clearIncludeFilters ()

Delete all the include filters currently tracked.

getDevice

public ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

getExcludeFilters

public  getExcludeFilters ()

Returns the current ERROR(/Set) of exclude filters.

Returns

getIncludeFilters

public  getIncludeFilters ()

Returns the current ERROR(/Set) of include filters.

Returns

run

public final 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

setBuild

public void setBuild (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

setDevice

public void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device ITestDevice: the ITestDevice to use

Protected methods

buildCommandLineArray

protected String[] buildCommandLineArray (String filePath, 
                String configPath)

Parameters
filePath String

configPath String

Returns
String[]

processYamlTestResults

protected void processYamlTestResults (InputStream inputStream, 
                MoblyYamlResultParser parser, 
                ITestInvocationListener listener, 
                String runName)

Parses Mobly test results and does result reporting.

Parameters
inputStream InputStream: An InputStream object reading in Mobly test result file.

parser MoblyYamlResultParser: An MoblyYamlResultParser object that processes Mobly test results.

listener ITestInvocationListener: An ITestInvocationListener instance that does various reporting.

runName String: str, the name of the Mobly test binary run.

reportLogs

protected void reportLogs (File logDir, 
                ITestInvocationListener listener)

Parameters
logDir File

listener ITestInvocationListener

updateConfigFile

protected void updateConfigFile (InputStream configInputStream, 
                Writer writer)

Parameters
configInputStream InputStream

writer Writer

Throws
HarnessRuntimeException