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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPackageConfig
(String name, PackageConfig packageContext) void
destroy()
Allow the Configuration to clean up any resources that have been used.getPackageConfig
(String name) The current runtime configuration.void
reloadContainer
(List<ContainerProvider> containerProviders) removePackageConfig
(String name) Removes a package from the the list of packages.void
void
setUnknownHandlerStack
(List<UnknownHandlerConfig> unknownHandlerStack)
-
Field Details
-
unknownHandlerStack
-
-
Constructor Details
-
MockConfiguration
public MockConfiguration()
-
-
Method Details
-
selfRegister
public void selfRegister() -
getPackageConfig
- Specified by:
getPackageConfig
in interfaceConfiguration
-
getPackageConfigNames
- Specified by:
getPackageConfigNames
in interfaceConfiguration
-
getPackageConfigs
- Specified by:
getPackageConfigs
in interfaceConfiguration
-
getRuntimeConfiguration
Description copied from interface:Configuration
The 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:
getRuntimeConfiguration
in interfaceConfiguration
- Returns:
- the current runtime configuration
-
addPackageConfig
- Specified by:
addPackageConfig
in interfaceConfiguration
-
destroy
public void destroy()Description copied from interface:Configuration
Allow the Configuration to clean up any resources that have been used.- Specified by:
destroy
in interfaceConfiguration
-
rebuildRuntimeConfiguration
public void rebuildRuntimeConfiguration()- Specified by:
rebuildRuntimeConfiguration
in interfaceConfiguration
-
removePackageConfig
Description copied from interface:Configuration
Removes a package from the the list of packages. Changes to the configuration won't take effect until buildRuntimeConfiguration is called.- Specified by:
removePackageConfig
in interfaceConfiguration
- Parameters:
name
- the name of the package to remove- Returns:
- the package removed (if any)
-
getContainer
- Specified by:
getContainer
in interfaceConfiguration
- Returns:
- the container
-
getLoadedFileNames
- Specified by:
getLoadedFileNames
in interfaceConfiguration
-
reloadContainer
public List<PackageProvider> reloadContainer(List<ContainerProvider> containerProviders) throws ConfigurationException - Specified by:
reloadContainer
in interfaceConfiguration
- Parameters:
containerProviders
- list of container providers- Returns:
- list of package providers
- Throws:
ConfigurationException
- in case of any configuration errors
-
getUnknownHandlerStack
- Specified by:
getUnknownHandlerStack
in interfaceConfiguration
- Returns:
- list of unknown handlers
-
setUnknownHandlerStack
- Specified by:
setUnknownHandlerStack
in interfaceConfiguration
- Parameters:
unknownHandlerStack
- list of unknown handlers
-