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, LinkedHashSet<SuiteTestFilter>> includeFilters, Map<String, LinkedHashSet<SuiteTestFilter>> excludeFilters, List<String> testArgs, List<String> moduleArgs)

Ctor for the SuiteModuleLoader.

Public methods

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

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

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

Pass the filters to the IRemoteTest.

static Set<File> getModuleNamesMatching(File directory, String suitePrefix, String pattern)
LinkedHashMap<String, IConfiguration> loadConfigsFromDirectory(List<File> testsDirs, 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.

LinkedHashMap<String, IConfiguration> loadConfigsFromSpecifiedPaths(List<File> listConfigFiles, Set<IAbi> abis, String suiteTag)

Main loading of configurations, looking into the specified files

LinkedHashMap<String, IConfiguration> loadTfConfigsFromSpecifiedPaths(List<String> configs, Set<IAbi> abis, String suiteTag)

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

final void setExcludedModuleParameters(Set<ModuleParameters> excludedParams)

Sets the set of ModuleParameters that should not be considered at all.

final void setFoldableStates(Set<DeviceFoldableState> foldableStates)

Sets the set of DeviceFoldableState that should be run.

final void setIgnoreNonPreloadedMainlineModule(boolean ignore)

Sets whether or not to ignore installing the module if it is not preloaded.

final void setInvocationContext(IInvocationContext context)
final void setLoadConfigsWithIncludeFilters(boolean allowed)

Sets whether or not to load test config based on the given include-filter.

final void setMainlineParameterizedModules(boolean allowed)

Sets whether or not to allow parameterized mainline modules.

final void setModuleParameter(ModuleParameters param)

Sets the only ModuleParameters type that should be run.

final void setOptimizeMainlineTest(boolean allowed)

Sets whether or not to optimize mainline test.

final void setOptionalParameterizedModules(boolean allowed)

Sets whether or not to allow optional parameterized modules.

final void setParameterizedModules(boolean allowed)

Sets whether or not to allow parameterized modules.

final void setUseIncludeFilterOrder(boolean useIncludeFilterOrder)

Sets whether or not to organize the test execution by the order specified in the include filter.

Constants

CONFIG_EXT

public static final String CONFIG_EXT

Constant Value: ".config"

Public constructors

SuiteModuleLoader

public SuiteModuleLoader (Map<String, LinkedHashSet<SuiteTestFilter>> includeFilters, 
                Map<String, LinkedHashSet<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, LinkedHashSet<SuiteTestFilter>> filters, 
                Set<IAbi> abis, 
                Set<DeviceFoldableState> foldableStates)

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.

foldableStates Set

addFiltersToTest

public void addFiltersToTest (IRemoteTest test, 
                IAbi abi, 
                String moduleId, 
                Map<String, LinkedHashSet<SuiteTestFilter>> includeFilters, 
                Map<String, LinkedHashSet<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.

moduleId String: The id of the module (usually abi + module name).

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 (List<File> testsDirs, 
                Set<IAbi> abis, 
                String suitePrefix, 
                String suiteTag, 
                List<String> patterns)

Main loading of configurations, looking into a folder

Parameters
testsDirs List

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>

loadConfigsFromSpecifiedPaths

public LinkedHashMap<String, IConfiguration> loadConfigsFromSpecifiedPaths (List<File> listConfigFiles, 
                Set<IAbi> abis, 
                String suiteTag)

Main loading of configurations, looking into the specified files

Parameters
listConfigFiles List

abis Set

suiteTag String

Returns
LinkedHashMap<String, IConfiguration>

loadTfConfigsFromSpecifiedPaths

public LinkedHashMap<String, IConfiguration> loadTfConfigsFromSpecifiedPaths (List<String> configs, 
                Set<IAbi> abis, 
                String suiteTag)

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

Parameters
configs List

abis Set

suiteTag String

Returns
LinkedHashMap<String, IConfiguration>

setExcludedModuleParameters

public final void setExcludedModuleParameters (Set<ModuleParameters> excludedParams)

Sets the set of ModuleParameters that should not be considered at all.

Parameters
excludedParams Set

setFoldableStates

public final void setFoldableStates (Set<DeviceFoldableState> foldableStates)

Sets the set of DeviceFoldableState that should be run.

Parameters
foldableStates Set

setIgnoreNonPreloadedMainlineModule

public final void setIgnoreNonPreloadedMainlineModule (boolean ignore)

Sets whether or not to ignore installing the module if it is not preloaded.

Parameters
ignore boolean

setInvocationContext

public final void setInvocationContext (IInvocationContext context)

Parameters
context IInvocationContext

setLoadConfigsWithIncludeFilters

public final void setLoadConfigsWithIncludeFilters (boolean allowed)

Sets whether or not to load test config based on the given include-filter.

Parameters
allowed boolean

setMainlineParameterizedModules

public final void setMainlineParameterizedModules (boolean allowed)

Sets whether or not to allow parameterized mainline modules.

Parameters
allowed boolean

setModuleParameter

public final void setModuleParameter (ModuleParameters param)

Sets the only ModuleParameters type that should be run.

Parameters
param ModuleParameters

setOptimizeMainlineTest

public final void setOptimizeMainlineTest (boolean allowed)

Sets whether or not to optimize mainline test.

Parameters
allowed boolean

setOptionalParameterizedModules

public final void setOptionalParameterizedModules (boolean allowed)

Sets whether or not to allow optional parameterized modules.

Parameters
allowed boolean

setParameterizedModules

public final void setParameterizedModules (boolean allowed)

Sets whether or not to allow parameterized modules.

Parameters
allowed boolean

setUseIncludeFilterOrder

public final void setUseIncludeFilterOrder (boolean useIncludeFilterOrder)

Sets whether or not to organize the test execution by the order specified in the include filter.

Parameters
useIncludeFilterOrder boolean