com.mockrunner.mock.web
Class MockActionMapping

java.lang.Object
  extended by org.apache.struts.config.BaseConfig
      extended by org.apache.struts.config.ActionConfig
          extended by org.apache.struts.action.ActionMapping
              extended by com.mockrunner.mock.web.MockActionMapping
All Implemented Interfaces:
java.io.Serializable

public class MockActionMapping
extends org.apache.struts.action.ActionMapping

Mock implementation of ActionMapping.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.struts.config.ActionConfig
actionId, attribute, cancellable, catalog, command, exceptions, extensionProcessed, forward, include, inherit, input, moduleConfig, multipartClass, name, parameter, path, prefix, roleNames, roles, scope, suffix, type, unknown, validate
 
Fields inherited from class org.apache.struts.config.BaseConfig
configured
 
Constructor Summary
MockActionMapping()
           
 
Method Summary
 void addForward(java.lang.String forwardName, java.lang.String forwardPath)
          Adds an ActionForward with the specified name and path.
 void clearForwards()
          Clears all specified forwards.
 org.apache.struts.action.ActionForward findForward(java.lang.String name)
          Always return a valid ActionForward since we do not care if it exists in the struts-config.
 java.lang.String[] findForwards()
          Returns all forward names (set using addForward(java.lang.String, java.lang.String) or setupForwards(java.lang.String[])).
 org.apache.struts.action.ActionForward getInputForward()
          Always return a valid ActionForward.
 void setupForwards(java.lang.String[] forwardNames)
          Sets multiple ActionForward objects with equal name and path.
 
Methods inherited from class org.apache.struts.config.ActionConfig
addExceptionConfig, addForwardConfig, checkCircularInheritance, findException, findExceptionConfig, findExceptionConfigs, findForwardConfig, findForwardConfigs, freeze, getActionId, getAttribute, getCancellable, getCatalog, getCommand, getExtends, getForward, getInclude, getInput, getModuleConfig, getMultipartClass, getName, getParameter, getPath, getPrefix, getRoleNames, getRoles, getScope, getSuffix, getType, getUnknown, getValidate, inheritExceptionHandlers, inheritForwards, inheritFrom, isExtensionProcessed, processExtends, removeExceptionConfig, removeForwardConfig, setActionId, setAttribute, setCancellable, setCatalog, setCommand, setExtends, setForward, setInclude, setInput, setModuleConfig, setMultipartClass, setName, setParameter, setPath, setPrefix, setRoles, setScope, setSuffix, setType, setUnknown, setValidate, toString
 
Methods inherited from class org.apache.struts.config.BaseConfig
copyProperties, getProperties, getProperty, inheritProperties, setProperties, setProperty, throwIfConfigured
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockActionMapping

public MockActionMapping()
Method Detail

clearForwards

public void clearForwards()
Clears all specified forwards.


findForward

public org.apache.struts.action.ActionForward findForward(java.lang.String name)
Always return a valid ActionForward since we do not care if it exists in the struts-config. If an ActionForward was defined using addForward(java.lang.String, java.lang.String), this ActionForward will be returned. Otherwise a new ActionForward (with equal name and path) will be returned.

Overrides:
findForward in class org.apache.struts.action.ActionMapping
Parameters:
name - the name
Returns:
the corresponding ActionForward

addForward

public void addForward(java.lang.String forwardName,
                       java.lang.String forwardPath)
Adds an ActionForward with the specified name and path.

Parameters:
forwardName - the name of the forward
forwardPath - the path of the forward

setupForwards

public void setupForwards(java.lang.String[] forwardNames)
Sets multiple ActionForward objects with equal name and path.

Parameters:
forwardNames - the forward names

findForwards

public java.lang.String[] findForwards()
Returns all forward names (set using addForward(java.lang.String, java.lang.String) or setupForwards(java.lang.String[])).

Overrides:
findForwards in class org.apache.struts.action.ActionMapping
Returns:
the forward names

getInputForward

public org.apache.struts.action.ActionForward getInputForward()
Always return a valid ActionForward. The input parameter of this mapping will be used as the name and path for the ActionForward.

Overrides:
getInputForward in class org.apache.struts.action.ActionMapping