Package org.apache.struts2.mock
Class MockActionProxy
java.lang.Object
org.apache.struts2.mock.MockActionProxy
- All Implemented Interfaces:
- ActionProxy
Mock for an 
ActionProxy.- Author:
- Patrick Lightbody (plightbo at gmail dot com)
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionexecute()Execute this ActionProxy.Gets the Action instance for this Proxy.Gets the alias name this ActionProxy is mapped to.Gets the ActionConfig this ActionProxy is built from.booleanGets the status of whether the ActionProxy is set to execute the Result after the Action is executed.Gets the method name to execute, or null if no method has been specified (meaningexecutewill be invoked).Gets the namespace the ActionConfig for this ActionProxy is mapped to.booleanbooleanGets status of the method value's initialization.voidprepare()voidvoidsetActionName(String actionName) voidsetConfig(ActionConfig config) voidsetExecuteResult(boolean executeResult) Sets whether this ActionProxy should also execute the Result after executing the Action.voidsetInvocation(ActionInvocation invocation) voidvoidsetMethodSpecified(boolean methodSpecified) voidsetNamespace(String namespace) voidsetReturnedResult(String returnedResult) 
- 
Constructor Details- 
MockActionProxypublic MockActionProxy()
 
- 
- 
Method Details- 
prepare- Throws:
- Exception
 
- 
executeDescription copied from interface:ActionProxyExecute 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:
- executein interface- ActionProxy
- Returns:
- the result code returned from executing the ActionInvocation
- Throws:
- Exception- can be thrown.
- See Also:
 
- 
setReturnedResult
- 
isExecutedCalledpublic boolean isExecutedCalled()
- 
getActionDescription copied from interface:ActionProxyGets the Action instance for this Proxy.- Specified by:
- getActionin interface- ActionProxy
- Returns:
- the Action instance
 
- 
setAction
- 
getActionNameDescription copied from interface:ActionProxyGets the alias name this ActionProxy is mapped to.- Specified by:
- getActionNamein interface- ActionProxy
- Returns:
- the alias name
 
- 
setActionName
- 
getConfigDescription copied from interface:ActionProxyGets the ActionConfig this ActionProxy is built from.- Specified by:
- getConfigin interface- ActionProxy
- Returns:
- the ActionConfig
 
- 
setConfig
- 
getExecuteResultpublic boolean getExecuteResult()Description copied from interface:ActionProxyGets the status of whether the ActionProxy is set to execute the Result after the Action is executed.- Specified by:
- getExecuteResultin interface- ActionProxy
- Returns:
- the status
 
- 
setExecuteResultpublic void setExecuteResult(boolean executeResult) Description copied from interface:ActionProxySets whether this ActionProxy should also execute the Result after executing the Action.- Specified by:
- setExecuteResultin interface- ActionProxy
- Parameters:
- executeResult- true to also execute the Result.
 
- 
getInvocation- Specified by:
- getInvocationin interface- ActionProxy
 
- 
setInvocation
- 
getNamespaceDescription copied from interface:ActionProxyGets the namespace the ActionConfig for this ActionProxy is mapped to.- Specified by:
- getNamespacein interface- ActionProxy
- Returns:
- the namespace
 
- 
setNamespace
- 
getMethodDescription copied from interface:ActionProxyGets the method name to execute, or null if no method has been specified (meaningexecutewill be invoked).- Specified by:
- getMethodin interface- ActionProxy
- Returns:
- the method to execute
 
- 
setMethod
- 
isMethodSpecifiedpublic boolean isMethodSpecified()Description copied from interface:ActionProxyGets status of the method value's initialization.- Specified by:
- isMethodSpecifiedin interface- ActionProxy
- Returns:
- true if the method returned by getMethod() is not a default initializer value.
 
- 
setMethodSpecifiedpublic void setMethodSpecified(boolean methodSpecified) 
 
-