com.opensymphony.xwork.mock
Class MockActionProxy

java.lang.Object
  extended by com.opensymphony.xwork.mock.MockActionProxy
All Implemented Interfaces:
ActionProxy

public class MockActionProxy
extends java.lang.Object
implements ActionProxy

Mock for an ActionProxy.

Author:
Patrick Lightbody (plightbo at gmail dot com)

Constructor Summary
MockActionProxy()
           
 
Method Summary
 java.lang.String execute()
          Execute this ActionProxy.
 java.lang.Object getAction()
           
 java.lang.String getActionName()
           
 ActionConfig getConfig()
           
 boolean getExecuteResult()
           
 ActionInvocation getInvocation()
           
 java.lang.String getMethod()
          Returns the method to execute, or null if no method has been specified (meaning "execute" will be invoked)
 java.lang.String getNamespace()
           
 boolean isExecutedCalled()
           
 void setAction(java.lang.Object action)
           
 void setActionName(java.lang.String actionName)
           
 void setConfig(ActionConfig config)
           
 void setExecuteResult(boolean executeResult)
          Sets whether this ActionProxy should also execute the Result after executing the Action
 void setInvocation(ActionInvocation invocation)
           
 void setMethod(java.lang.String method)
          Sets the method to execute for the action invocation.
 void setNamespace(java.lang.String namespace)
           
 void setReturnedResult(java.lang.String returnedResult)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockActionProxy

public MockActionProxy()
Method Detail

execute

public java.lang.String execute()
                         throws java.lang.Exception
Description copied from interface: ActionProxy
Execute this ActionProxy. This will set the ActionContext from the ActionInvocation into the ActionContext ThreadLocal before invoking the ActionInvocation, then set the old ActionContext back into the ThreadLocal.

Specified by:
execute in interface ActionProxy
Returns:
the result code returned from executing the ActionInvocation
Throws:
java.lang.Exception
See Also:
ActionInvocation

setReturnedResult

public void setReturnedResult(java.lang.String returnedResult)

isExecutedCalled

public boolean isExecutedCalled()

getAction

public java.lang.Object getAction()
Specified by:
getAction in interface ActionProxy
Returns:
the Action instance for this Proxy

setAction

public void setAction(java.lang.Object action)

getActionName

public java.lang.String getActionName()
Specified by:
getActionName in interface ActionProxy
Returns:
the alias name this ActionProxy is mapped to

setActionName

public void setActionName(java.lang.String actionName)

getConfig

public ActionConfig getConfig()
Specified by:
getConfig in interface ActionProxy
Returns:
the ActionConfig this ActionProxy is built from

setConfig

public void setConfig(ActionConfig config)

getExecuteResult

public boolean getExecuteResult()
Specified by:
getExecuteResult in interface ActionProxy
Returns:
the status of whether the ActionProxy is set to execute the Result after the Action is executed

setExecuteResult

public void setExecuteResult(boolean executeResult)
Description copied from interface: ActionProxy
Sets whether this ActionProxy should also execute the Result after executing the Action

Specified by:
setExecuteResult in interface ActionProxy

getInvocation

public ActionInvocation getInvocation()
Specified by:
getInvocation in interface ActionProxy
Returns:
the ActionInvocation associated with this ActionProxy

setInvocation

public void setInvocation(ActionInvocation invocation)

getNamespace

public java.lang.String getNamespace()
Specified by:
getNamespace in interface ActionProxy
Returns:
the namespace the ActionConfig for this ActionProxy is mapped to

setNamespace

public void setNamespace(java.lang.String namespace)

getMethod

public java.lang.String getMethod()
Description copied from interface: ActionProxy
Returns the method to execute, or null if no method has been specified (meaning "execute" will be invoked)

Specified by:
getMethod in interface ActionProxy

setMethod

public void setMethod(java.lang.String method)
Description copied from interface: ActionProxy
Sets the method to execute for the action invocation. If no method is specified, the method provided by in the action's configuration will be used.

Specified by:
setMethod in interface ActionProxy
Parameters:
method - the string name of the method to invoke

XWork Project Page