MoblyBinaryHostTest

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

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.

split(int shardCountHint)

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

Protected methods

String[] buildCommandLineArray(String filePath, String configPath, tests)
String[] buildCommandLineArray(String filePath, String configPath)
filterTests(String[] testListLines, String runName, ITestInvocationListener listener)
String getLogDirAbsolutePath()
File getLogDirFile()
boolean 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

split

public  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 arbitrarily decide sometimes.

Parameters
shardCountHint int: the attempted shard count.

Returns
a collection of subtests to be executed separately or null if test is not currently shardable

Protected methods

buildCommandLineArray

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

Parameters
filePath String

configPath String

tests

Returns
String[]

buildCommandLineArray

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

Parameters
filePath String

configPath String

Returns
String[]

filterTests

protected  filterTests (String[] testListLines, 
                String runName, 
                ITestInvocationListener listener)

Parameters
testListLines String

runName String

listener ITestInvocationListener

Returns

getLogDirAbsolutePath

protected String getLogDirAbsolutePath ()

Returns
String

getLogDirFile

protected File getLogDirFile ()

Returns
File

processYamlTestResults

protected boolean 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.

Returns
boolean

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