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 ERROR(/FilenameFilter) to find all the config files in a directory. 

Fields

public static final String CONFIG_EXT

Public constructors

SuiteModuleLoader( includeFilters, excludeFilters, testArgs, moduleArgs)

Ctor for the SuiteModuleLoader.

Public methods

static void addFilters( stringFilters, filters, abis, foldableStates)

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

void addFiltersToTest(File moduleDir, IRemoteTest test, IAbi abi, String moduleId, includeFilters, excludeFilters)

Pass the filters to the IRemoteTest.

static getModuleNamesMatching(File directory, String suitePrefix, String pattern)
loadConfigsFromDirectory( testsDirs, abis, String suitePrefix, String suiteTag, patterns)

Main loading of configurations, looking into a folder

loadConfigsFromJars( abis, String suitePrefix, String suiteTag)

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

loadConfigsFromSpecifiedPaths( listConfigFiles, abis, String suiteTag)

Main loading of configurations, looking into the specified files

loadTfConfigsFromSpecifiedPaths( configs, abis, String suiteTag)

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

final void setExcludedModuleParameters( excludedParams)

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

final void setFoldableStates( 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.

Fields

CONFIG_EXT

public static final String CONFIG_EXT

Public constructors

SuiteModuleLoader

public SuiteModuleLoader ( includeFilters, 
                 excludeFilters, 
                 testArgs, 
                 moduleArgs)

Ctor for the SuiteModuleLoader.

Parameters
includeFilters : The formatted and parsed include filters.

excludeFilters : The formatted and parsed exclude filters.

testArgs : the list of test (IRemoteTest) arguments.

moduleArgs : the list of module arguments.

Public methods

addFilters

public static void addFilters ( stringFilters, 
                 filters, 
                 abis, 
                 foldableStates)

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

Parameters
stringFilters : The original option filters format.

filters : The filters parsed from the string format.

abis : The Abis to consider in the filtering.

foldableStates

addFiltersToTest

public void addFiltersToTest (File moduleDir, 
                IRemoteTest test, 
                IAbi abi, 
                String moduleId, 
                 includeFilters, 
                 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
moduleDir File: The module directory

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 : The formatted and parsed include filters.

excludeFilters : The formatted and parsed exclude filters.

getModuleNamesMatching

public static  getModuleNamesMatching (File directory, 
                String suitePrefix, 
                String pattern)

Parameters
directory File

suitePrefix String

pattern String

Returns
the ERROR(/Set) of modules whose name contains the given pattern.

loadConfigsFromDirectory

public  loadConfigsFromDirectory ( testsDirs, 
                 abis, 
                String suitePrefix, 
                String suiteTag, 
                 patterns)

Main loading of configurations, looking into a folder

Parameters
testsDirs

abis

suitePrefix String

suiteTag String

patterns

Returns

loadConfigsFromJars

public  loadConfigsFromJars ( abis, 
                String suitePrefix, 
                String suiteTag)

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

Parameters
abis

suitePrefix String

suiteTag String

Returns

loadConfigsFromSpecifiedPaths

public  loadConfigsFromSpecifiedPaths ( listConfigFiles, 
                 abis, 
                String suiteTag)

Main loading of configurations, looking into the specified files

Parameters
listConfigFiles

abis

suiteTag String

Returns

loadTfConfigsFromSpecifiedPaths

public  loadTfConfigsFromSpecifiedPaths ( configs, 
                 abis, 
                String suiteTag)

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

Parameters
configs

abis

suiteTag String

Returns

setExcludedModuleParameters

public final void setExcludedModuleParameters ( excludedParams)

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

Parameters
excludedParams

setFoldableStates

public final void setFoldableStates ( foldableStates)

Sets the set of DeviceFoldableState that should be run.

Parameters
foldableStates

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