com.opensymphony.xwork2.config.impl
Class MockConfiguration

java.lang.Object
  extended by com.opensymphony.xwork2.config.impl.MockConfiguration
All Implemented Interfaces:
Configuration, java.io.Serializable

public class MockConfiguration
extends java.lang.Object
implements Configuration

Simple configuration used for unit testing

See Also:
Serialized Form

Field Summary
protected  java.util.List<UnknownHandlerConfig> unknownHandlerStack
           
 
Constructor Summary
MockConfiguration()
           
 
Method Summary
 void addPackageConfig(java.lang.String name, PackageConfig packageContext)
           
 void buildRuntimeConfiguration()
           
 void destroy()
          Allow the Configuration to clean up any resources that have been used.
 Container getContainer()
           
 java.util.Set<java.lang.String> getLoadedFileNames()
           
 PackageConfig getPackageConfig(java.lang.String name)
           
 java.util.Set<java.lang.String> getPackageConfigNames()
           
 java.util.Map<java.lang.String,PackageConfig> getPackageConfigs()
           
 RuntimeConfiguration getRuntimeConfiguration()
          The current runtime configuration.
 java.util.List<UnknownHandlerConfig> getUnknownHandlerStack()
           
 void rebuildRuntimeConfiguration()
           
 void reload(java.util.List<ConfigurationProvider> providers)
           
 java.util.List<PackageProvider> reloadContainer(java.util.List<ContainerProvider> containerProviders)
           
 PackageConfig removePackageConfig(java.lang.String name)
          Removes a package from the the list of packages.
 void selfRegister()
           
 void setUnknownHandlerStack(java.util.List<UnknownHandlerConfig> unknownHandlerStack)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unknownHandlerStack

protected java.util.List<UnknownHandlerConfig> unknownHandlerStack
Constructor Detail

MockConfiguration

public MockConfiguration()
Method Detail

selfRegister

public void selfRegister()

getPackageConfig

public PackageConfig getPackageConfig(java.lang.String name)
Specified by:
getPackageConfig in interface Configuration

getPackageConfigNames

public java.util.Set<java.lang.String> getPackageConfigNames()
Specified by:
getPackageConfigNames in interface Configuration

getPackageConfigs

public java.util.Map<java.lang.String,PackageConfig> getPackageConfigs()
Specified by:
getPackageConfigs in interface Configuration

getRuntimeConfiguration

public RuntimeConfiguration 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 interface Configuration
Returns:
the current runtime configuration

addPackageConfig

public void addPackageConfig(java.lang.String name,
                             PackageConfig packageContext)
Specified by:
addPackageConfig in interface Configuration

buildRuntimeConfiguration

public void buildRuntimeConfiguration()

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 interface Configuration

rebuildRuntimeConfiguration

public void rebuildRuntimeConfiguration()
Specified by:
rebuildRuntimeConfiguration in interface Configuration

reload

public void reload(java.util.List<ConfigurationProvider> providers)
            throws ConfigurationException
Specified by:
reload in interface Configuration
Throws:
ConfigurationException

removePackageConfig

public PackageConfig removePackageConfig(java.lang.String name)
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 interface Configuration
Parameters:
name - the name of the package to remove
Returns:
the package removed (if any)

getContainer

public Container getContainer()
Specified by:
getContainer in interface Configuration
Returns:
the container

getLoadedFileNames

public java.util.Set<java.lang.String> getLoadedFileNames()
Specified by:
getLoadedFileNames in interface Configuration

reloadContainer

public java.util.List<PackageProvider> reloadContainer(java.util.List<ContainerProvider> containerProviders)
                                                throws ConfigurationException
Specified by:
reloadContainer in interface Configuration
Throws:
ConfigurationException

getUnknownHandlerStack

public java.util.List<UnknownHandlerConfig> getUnknownHandlerStack()
Specified by:
getUnknownHandlerStack in interface Configuration
Returns:
list of unknown handlers

setUnknownHandlerStack

public void setUnknownHandlerStack(java.util.List<UnknownHandlerConfig> unknownHandlerStack)
Specified by:
setUnknownHandlerStack in interface Configuration


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.