BaseTestSuite

public class BaseTestSuite
extends ITestSuite

java.lang.Object
   ↳ com.android.tradefed.testtype.suite.ITestSuite
     ↳ com.android.tradefed.testtype.suite.BaseTestSuite


A Test for running Compatibility Test Suite with new suite system.

Summary

Constants

String EXCLUDE_FILTER_OPTION

String INCLUDE_FILTER_OPTION

String MODULE_OPTION

String TEST_ARG_OPTION

String TEST_OPTION

char TEST_OPTION_SHORT_NAME

Public constructors

BaseTestSuite()

Public methods

void addModuleArgs(Set<String> moduleArgs)

Adds module args

SuiteModuleLoader createModuleLoader(Map<String, List<SuiteTestFilter>> includeFiltersFormatted, Map<String, List<SuiteTestFilter>> excludeFiltersFormatted, List<String> testArgs, List<String> moduleArgs)

Create the SuiteModuleLoader responsible to load the IConfiguration and assign them some of the options.

SuiteModuleLoader getModuleLoader()

Returns the current SuiteModuleLoader.

File getTestsDir()
LinkedHashMap<String, IConfiguration> loadTests()

Abstract method to load the tests configuration that will be run.

LinkedHashMap<String, IConfiguration> loadingStrategy(Set<IAbi> abis, File testsDir, String suitePrefix, String suiteTag)

Default loading strategy will load from the resources and the tests directory.

void setBuild(IBuildInfo buildInfo)

void setExcludeFilter(Set<String> excludeFilters)

Sets exclude-filters for the compatibility test

void setIncludeFilter(Set<String> includeFilters)

Sets include-filters for the compatibility test

Protected methods

Set<String> getIncludeFilter()

Gets a copy of include-filters for the compatibility test

void setupFilters(File testsDir)

Sets the include/exclude filters up based on if a module name was given.

Constants

EXCLUDE_FILTER_OPTION

public static final String EXCLUDE_FILTER_OPTION

Constant Value: "exclude-filter"

INCLUDE_FILTER_OPTION

public static final String INCLUDE_FILTER_OPTION

Constant Value: "include-filter"

MODULE_OPTION

public static final String MODULE_OPTION

Constant Value: "module"

TEST_ARG_OPTION

public static final String TEST_ARG_OPTION

Constant Value: "test-arg"

TEST_OPTION

public static final String TEST_OPTION

Constant Value: "test"

TEST_OPTION_SHORT_NAME

public static final char TEST_OPTION_SHORT_NAME

Constant Value: 116 (0x00000074)

Public constructors

BaseTestSuite

public BaseTestSuite ()

Public methods

addModuleArgs

public void addModuleArgs (Set<String> moduleArgs)

Adds module args

Parameters
moduleArgs Set

createModuleLoader

public SuiteModuleLoader createModuleLoader (Map<String, List<SuiteTestFilter>> includeFiltersFormatted, 
                Map<String, List<SuiteTestFilter>> excludeFiltersFormatted, 
                List<String> testArgs, 
                List<String> moduleArgs)

Create the SuiteModuleLoader responsible to load the IConfiguration and assign them some of the options.

Parameters
includeFiltersFormatted Map: The formatted and parsed include filters.

excludeFiltersFormatted Map: The formatted and parsed exclude filters.

testArgs List: the list of test (IRemoteTest) arguments.

moduleArgs List: the list of module arguments.

Returns
SuiteModuleLoader the created SuiteModuleLoader.

getModuleLoader

public SuiteModuleLoader getModuleLoader ()

Returns the current SuiteModuleLoader.

Returns
SuiteModuleLoader

getTestsDir

public File getTestsDir ()

Returns
File

Throws
FileNotFoundException

loadTests

public LinkedHashMap<String, IConfiguration> loadTests ()

Abstract method to load the tests configuration that will be run. Each tests is defined by a IConfiguration and a unique name under which it will report results.

Returns
LinkedHashMap<String, IConfiguration>

loadingStrategy

public LinkedHashMap<String, IConfiguration> loadingStrategy (Set<IAbi> abis, 
                File testsDir, 
                String suitePrefix, 
                String suiteTag)

Default loading strategy will load from the resources and the tests directory. Can be extended or replaced.

Parameters
abis Set: The set of abis to run against.

testsDir File: The tests directory.

suitePrefix String: A prefix to filter the resource directory.

suiteTag String: The suite tag a module should have to be included. Can be null.

Returns
LinkedHashMap<String, IConfiguration> A list of loaded configuration for the suite.

setBuild

public void setBuild (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

setExcludeFilter

public void setExcludeFilter (Set<String> excludeFilters)

Sets exclude-filters for the compatibility test

Parameters
excludeFilters Set

setIncludeFilter

public void setIncludeFilter (Set<String> includeFilters)

Sets include-filters for the compatibility test

Parameters
includeFilters Set

Protected methods

getIncludeFilter

protected Set<String> getIncludeFilter ()

Gets a copy of include-filters for the compatibility test

Returns
Set<String>

setupFilters

protected void setupFilters (File testsDir)

Sets the include/exclude filters up based on if a module name was given.

Parameters
testsDir File

Throws
FileNotFoundException if any file is not found.