to top
public class

GlobalConfiguration

extends Object
implements IGlobalConfiguration
java.lang.Object
   ↳ com.android.tradefed.config.GlobalConfiguration

Class Overview

An IGlobalConfiguration implementation that stores the loaded config objects in a map

Summary

Constants
String DEVICE_MANAGER_TYPE_NAME
String DEVICE_MONITOR_TYPE_NAME
String DEVICE_REQUIREMENTS_TYPE_NAME
String HOST_OPTIONS_TYPE_NAME
String MULTI_DEVICE_RECOVERY_TYPE_NAME
String SCHEDULER_TYPE_NAME
String WTF_HANDLER_TYPE_NAME
Public Methods
static List<String> createGlobalConfiguration(String[] args)
Sets up the GlobalConfiguration singleton for this TF instance.
ICommandScheduler getCommandScheduler()
Gets the ICommandScheduler to use from the configuration.
Object getConfigurationObject(String typeName)
Gets the custom configuration object with given name.
List<?> getConfigurationObjectList(String typeName)
String getDescription()
IDeviceManager getDeviceManager()
Gets the IDeviceManager to use from the configuration.
static IDeviceManager getDeviceManagerInstance()
Returns a reference to the singleton DeviceManager instance for this TF instance.
List<IDeviceMonitor> getDeviceMonitors()
Gets the list of IDeviceMonitor from the global config.
IDeviceSelection getDeviceRequirements()
Gets the IDeviceSelection to use from the configuration.
static IGlobalConfiguration getInstance()
Returns a reference to the singleton GlobalConfiguration instance for this TF instance.
IMultiDeviceRecovery getMultiDeviceRecovery()
Gets the IMultiDeviceRecovery to use from the configuration.
String getName()
List<String> getOptionValues(String optionName)
Get a list of option's values.
ITerribleFailureHandler getWtfHandler()
Gets the ITerribleFailureHandler to use from the configuration.
void injectOptionValue(String optionName, String optionKey, String optionValue)
Inject a option value into the set of configuration objects.
void injectOptionValue(String optionName, String optionValue)
Inject a option value into the set of configuration objects.
void printCommandUsage(boolean importantOnly, PrintStream out)
Outputs a command line usage help text for this configuration to given printStream.
void setCommandScheduler(ICommandScheduler scheduler)
Set the ICommandScheduler, replacing any existing values.
void setConfigurationObject(String typeName, Object configObject)
Generic method to set the config object with the given name, replacing any existing value.
void setConfigurationObjectList(String typeName, List<?> configList)
Generic method to set the config object list for the given name, replacing any existing value.
void setDeviceManager(IDeviceManager manager)
Set the IDeviceManager, replacing any existing values.
void setDeviceMonitor(IDeviceMonitor monitor)
Set the IDeviceMonitor.
void setDeviceRequirements(IDeviceSelection devRequirements)
Set the IDeviceSelection, replacing any existing values.
List<String> setOptionsFromCommandLineArgs(List<String> listArgs)
Set the global config Option fields with given set of command line arguments

void setWtfHandler(ITerribleFailureHandler wtfHandler)
void validateOptions()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.config.IGlobalConfiguration

Constants

public static final String DEVICE_MANAGER_TYPE_NAME

Constant Value: "device_manager"

public static final String DEVICE_MONITOR_TYPE_NAME

Constant Value: "device_monitor"

public static final String DEVICE_REQUIREMENTS_TYPE_NAME

Constant Value: "device_requirements"

public static final String HOST_OPTIONS_TYPE_NAME

Constant Value: "host_options"

public static final String MULTI_DEVICE_RECOVERY_TYPE_NAME

Constant Value: "multi_device_recovery"

public static final String SCHEDULER_TYPE_NAME

Constant Value: "command_scheduler"

public static final String WTF_HANDLER_TYPE_NAME

Constant Value: "wtf_handler"

Public Methods

public static List<String> createGlobalConfiguration (String[] args)

Sets up the GlobalConfiguration singleton for this TF instance. Must be called once and only once, before anything attempts to call

Throws
IllegalStateException if called more than once
ConfigurationException

public ICommandScheduler getCommandScheduler ()

Gets the ICommandScheduler to use from the configuration.

Returns

public Object getConfigurationObject (String typeName)

Gets the custom configuration object with given name.

Parameters
typeName the unique type of the configuration object
Returns
  • the object or null if object with that name is not found

public List<?> getConfigurationObjectList (String typeName)

public String getDescription ()

Returns

public IDeviceManager getDeviceManager ()

Gets the IDeviceManager to use from the configuration. Manages the set of available devices for testing

Returns

public static IDeviceManager getDeviceManagerInstance ()

Returns a reference to the singleton DeviceManager instance for this TF instance.

Throws
IllegalStateException if has not already been called.

public List<IDeviceMonitor> getDeviceMonitors ()

Gets the list of IDeviceMonitor from the global config.

Returns
  • the list of IDeviceMonitor from the global config, or null if none was specified.

public IDeviceSelection getDeviceRequirements ()

Gets the IDeviceSelection to use from the configuration. Represents a global filter on which devices the DeviceManager can see.

Returns

public static IGlobalConfiguration getInstance ()

Returns a reference to the singleton GlobalConfiguration instance for this TF instance.

Throws
IllegalStateException if has not already been called.

public IMultiDeviceRecovery getMultiDeviceRecovery ()

Gets the IMultiDeviceRecovery to use from the configuration.

Returns

public String getName ()

Returns

public List<String> getOptionValues (String optionName)

Get a list of option's values.

Parameters
optionName the map option name

public ITerribleFailureHandler getWtfHandler ()

Gets the ITerribleFailureHandler to use from the configuration. Handles what to do in the event that a WTF (What a Terrible Failure) occurs.

Returns

public void injectOptionValue (String optionName, String optionKey, String optionValue)

Inject a option value into the set of configuration objects.

Useful to provide values for options that are generated dynamically.

Parameters
optionName the map option name
optionKey the map option key
optionValue the map option value

public void injectOptionValue (String optionName, String optionValue)

Inject a option value into the set of configuration objects.

Useful to provide values for options that are generated dynamically.

Parameters
optionName the option name
optionValue the option value(s)

public void printCommandUsage (boolean importantOnly, PrintStream out)

Outputs a command line usage help text for this configuration to given printStream.

Parameters
out the PrintStream to use.
Throws
ConfigurationException}
ConfigurationException

public void setCommandScheduler (ICommandScheduler scheduler)

Set the ICommandScheduler, replacing any existing values.

public void setConfigurationObject (String typeName, Object configObject)

Generic method to set the config object with the given name, replacing any existing value.

Parameters
typeName the unique name of the config object type.
configObject the config object

public void setConfigurationObjectList (String typeName, List<?> configList)

Generic method to set the config object list for the given name, replacing any existing value.

Parameters
typeName the unique name of the config object type.
configList the config object list

public void setDeviceManager (IDeviceManager manager)

Set the IDeviceManager, replacing any existing values. This sets the manager for the test devices

public void setDeviceMonitor (IDeviceMonitor monitor)

Set the IDeviceMonitor.

Parameters
monitor The monitor

public void setDeviceRequirements (IDeviceSelection devRequirements)

Set the IDeviceSelection, replacing any existing values. This sets a global device filter on which devices the DeviceManager can see.

public List<String> setOptionsFromCommandLineArgs (List<String> listArgs)

Set the global config Option fields with given set of command line arguments

Parameters
listArgs the command line arguments
Returns
  • the unconsumed arguments

public void setWtfHandler (ITerribleFailureHandler wtfHandler)

Parameters
wtfHandler the WTF handler

public void validateOptions ()