com.mockrunner.mock.web
Class MockActionMapping

java.lang.Object
  extended byorg.apache.struts.config.ActionConfig
      extended byorg.apache.struts.action.ActionMapping
          extended bycom.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
attribute, configured, exceptions, forward, include, input, moduleConfig, multipartClass, name, parameter, path, prefix, roleNames, roles, scope, suffix, type, unknown, validate
 
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.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.struts.config.ActionConfig
addExceptionConfig, addForwardConfig, findException, findExceptionConfig, findExceptionConfigs, findForwardConfig, findForwardConfigs, freeze, getAttribute, getForward, getInclude, getInput, getModuleConfig, getMultipartClass, getName, getParameter, getPath, getPrefix, getRoleNames, getRoles, getScope, getSuffix, getType, getUnknown, getValidate, removeExceptionConfig, removeForwardConfig, setAttribute, setForward, setInclude, setInput, setModuleConfig, setMultipartClass, setName, setParameter, setPath, setPrefix, setRoles, setScope, setSuffix, setType, setUnknown, setValidate
 
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.

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[])).

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.


toString

public java.lang.String toString()