Package org.apache.struts2.config.impl
Class MockConfiguration
java.lang.Object
org.apache.struts2.config.impl.MockConfiguration
- All Implemented Interfaces:
Serializable,Configuration
Simple configuration used for unit testing
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPackageConfig(String name, PackageConfig packageContext) voiddestroy()Allow the Configuration to clean up any resources that have been used.getPackageConfig(String name) The current runtime configuration.voidreloadContainer(List<ContainerProvider> containerProviders) removePackageConfig(String name) Removes a package from the the list of packages.voidvoidsetUnknownHandlerStack(List<UnknownHandlerConfig> unknownHandlerStack)
-
Field Details
-
unknownHandlerStack
-
-
Constructor Details
-
MockConfiguration
public MockConfiguration()
-
-
Method Details
-
selfRegister
public void selfRegister() -
getPackageConfig
- Specified by:
getPackageConfigin interfaceConfiguration
-
getPackageConfigNames
- Specified by:
getPackageConfigNamesin interfaceConfiguration
-
getPackageConfigs
- Specified by:
getPackageConfigsin interfaceConfiguration
-
getRuntimeConfiguration
Description copied from interface:ConfigurationThe current runtime configuration. Currently, if changes have been made to the Configuration since the last time buildRuntimeConfiguration() was called, you'll need to make sure to.- Specified by:
getRuntimeConfigurationin interfaceConfiguration- Returns:
- the current runtime configuration
-
addPackageConfig
- Specified by:
addPackageConfigin interfaceConfiguration
-
destroy
public void destroy()Description copied from interface:ConfigurationAllow the Configuration to clean up any resources that have been used.- Specified by:
destroyin interfaceConfiguration
-
rebuildRuntimeConfiguration
public void rebuildRuntimeConfiguration()- Specified by:
rebuildRuntimeConfigurationin interfaceConfiguration
-
removePackageConfig
Description copied from interface:ConfigurationRemoves a package from the the list of packages. Changes to the configuration won't take effect until buildRuntimeConfiguration is called.- Specified by:
removePackageConfigin interfaceConfiguration- Parameters:
name- the name of the package to remove- Returns:
- the package removed (if any)
-
getContainer
- Specified by:
getContainerin interfaceConfiguration- Returns:
- the container
-
getLoadedFileNames
- Specified by:
getLoadedFileNamesin interfaceConfiguration
-
reloadContainer
public List<PackageProvider> reloadContainer(List<ContainerProvider> containerProviders) throws ConfigurationException - Specified by:
reloadContainerin interfaceConfiguration- Parameters:
containerProviders- list of container providers- Returns:
- list of package providers
- Throws:
ConfigurationException- in case of any configuration errors
-
getUnknownHandlerStack
- Specified by:
getUnknownHandlerStackin interfaceConfiguration- Returns:
- list of unknown handlers
-
setUnknownHandlerStack
- Specified by:
setUnknownHandlerStackin interfaceConfiguration- Parameters:
unknownHandlerStack- list of unknown handlers
-