Package org.robolectric.plugins
Class ConfigConfigurer
java.lang.Object
org.robolectric.plugins.ConfigConfigurer
- All Implemented Interfaces:
- Configurer<Config>
@AutoService(Configurer.class)
public class ConfigConfigurer
extends Object
implements Configurer<Config>
Provides configuration to Robolectric for its @
Config annotation.- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConfigConfigurer(PackagePropertiesLoader packagePropertiesLoader) ConfigConfigurer(PackagePropertiesLoader packagePropertiesLoader, GlobalConfigProvider defaultConfigProvider) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the default configuration for tests that do not specify a configuration of this type.static Configget(ConfigurationStrategy.Configuration testConfig) Retrieve the class type for this ConfigurergetConfigFor(Class<?> testClass) Returns the configuration for the given class.getConfigFor(Method method) Returns the configuration for the given method.getConfigFor(String packageName) Returns the configuration for a given package.Merges two configurations.
- 
Constructor Details- 
ConfigConfigurer
- 
ConfigConfigurerpublic ConfigConfigurer(PackagePropertiesLoader packagePropertiesLoader, GlobalConfigProvider defaultConfigProvider) 
 
- 
- 
Method Details- 
get
- 
getConfigClassDescription copied from interface:ConfigurerRetrieve the class type for this Configurer- Specified by:
- getConfigClassin interface- Configurer<Config>
 
- 
defaultConfigDescription copied from interface:ConfigurerReturns the default configuration for tests that do not specify a configuration of this type.- Specified by:
- defaultConfigin interface- Configurer<Config>
 
- 
getConfigForDescription copied from interface:ConfigurerReturns the configuration for a given package.This method will be called once for package in the hierarchy leading to the test class being configured. For example, for com.example.FooTest, this method will be called three times with"com.example","@com", and""(representing the top level package).- Specified by:
- getConfigForin interface- Configurer<Config>
- Parameters:
- packageName- the name of the package, or the empty string representing the top level unnamed package
- Returns:
- a configuration object, or null if the given properties has no relevant data for this configuration
 
- 
getConfigForDescription copied from interface:ConfigurerReturns the configuration for the given class.This method will be called for each class in the test's class inheritance hierarchy. - Specified by:
- getConfigForin interface- Configurer<Config>
- Returns:
- a configuration object, or null if the given class has no relevant data for this configuration
 
- 
getConfigForDescription copied from interface:ConfigurerReturns the configuration for the given method.- Specified by:
- getConfigForin interface- Configurer<Config>
- Returns:
- a configuration object, or null if the given method has no relevant data for this configuration
 
- 
mergeDescription copied from interface:ConfigurerMerges two configurations.This method will called whenever Configurer.getConfigFor(java.lang.String)returns a non-null configuration object.- Specified by:
- mergein interface- Configurer<Config>
- Parameters:
- parentConfig- a less specific configuration object
- childConfig- a more specific configuration object
- Returns:
- the new configuration with merged parent and child data.
 
 
-