SuiteModuleLoader

public class SuiteModuleLoader
extends Object

java.lang.Object
   ↳ com.android.tradefed.testtype.suite.SuiteModuleLoader


Retrieves Compatibility test module definitions from the repository. TODO: Add the expansion of suite when loading a module.

Summary

Nested classes

class SuiteModuleLoader.ConfigFilter

A FilenameFilter to find all the config files in a directory. 

Constants

String CONFIG_EXT

Public constructors

SuiteModuleLoader(Map<String, List<SuiteTestFilter>> includeFilters, Map<String, List<SuiteTestFilter>> excludeFilters, List<String> testArgs, List<String> moduleArgs)

Ctor for the SuiteModuleLoader.

Public methods

static void addFilters(Set<String> stringFilters, Map<String, List<SuiteTestFilter>> filters, Set<IAbi> abis)

Utility method that allows to parse and create a structure with the option filters.

void addFiltersToTest(IRemoteTest test, IAbi abi, String name, Map<String, List<SuiteTestFilter>> includeFilters, Map<String, List<SuiteTestFilter>> excludeFilters)

Pass the filters to the IRemoteTest.

static Set<File> getModuleNamesMatching(File directory, String suitePrefix, String pattern)
LinkedHashMap<String, IConfiguration> loadConfigsFromDirectory(File testsDir, Set<IAbi> abis, String suitePrefix, String suiteTag, List<String> patterns)

Main loading of configurations, looking into a folder

LinkedHashMap<String, IConfiguration> loadConfigsFromJars(Set<IAbi> abis, String suitePrefix, String suiteTag)

Main loading of configurations, looking into the resources on the classpath.

Constants

CONFIG_EXT

public static final String CONFIG_EXT

Constant Value: ".config"

Public constructors

SuiteModuleLoader

public SuiteModuleLoader (Map<String, List<SuiteTestFilter>> includeFilters, 
                Map<String, List<SuiteTestFilter>> excludeFilters, 
                List<String> testArgs, 
                List<String> moduleArgs)

Ctor for the SuiteModuleLoader.

Parameters
includeFilters Map: The formatted and parsed include filters.

excludeFilters Map: The formatted and parsed exclude filters.

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

moduleArgs List: the list of module arguments.

Public methods

addFilters

public static void addFilters (Set<String> stringFilters, 
                Map<String, List<SuiteTestFilter>> filters, 
                Set<IAbi> abis)

Utility method that allows to parse and create a structure with the option filters.

Parameters
stringFilters Set: The original option filters format.

filters Map: The filters parsed from the string format.

abis Set: The Abis to consider in the filtering.

addFiltersToTest

public void addFiltersToTest (IRemoteTest test, 
                IAbi abi, 
                String name, 
                Map<String, List<SuiteTestFilter>> includeFilters, 
                Map<String, List<SuiteTestFilter>> excludeFilters)

Pass the filters to the IRemoteTest. Default behavior is to ignore if the IRemoteTest does not implements ITestFileFilterReceiver. This can be overriden to create a more restrictive behavior.

Parameters
test IRemoteTest: The IRemoteTest that is being considered.

abi IAbi: The Abi we are currently working on.

name String: The name of the module.

includeFilters Map: The formatted and parsed include filters.

excludeFilters Map: The formatted and parsed exclude filters.

getModuleNamesMatching

public static Set<File> getModuleNamesMatching (File directory, 
                String suitePrefix, 
                String pattern)

Parameters
directory File

suitePrefix String

pattern String

Returns
Set<File> the Set of modules whose name contains the given pattern.

loadConfigsFromDirectory

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

Main loading of configurations, looking into a folder

Parameters
testsDir File

abis Set

suitePrefix String

suiteTag String

patterns List

Returns
LinkedHashMap<String, IConfiguration>

loadConfigsFromJars

public LinkedHashMap<String, IConfiguration> loadConfigsFromJars (Set<IAbi> abis, 
                String suitePrefix, 
                String suiteTag)

Main loading of configurations, looking into the resources on the classpath. (TF configs for example).

Parameters
abis Set

suitePrefix String

suiteTag String

Returns
LinkedHashMap<String, IConfiguration>