com.opensymphony.xwork2.mock

## Class MockActionProxy

- java.lang.Object
- - com.opensymphony.xwork2.mock.MockActionProxy

- All Implemented Interfaces:
    ActionProxy

      public class MockActionProxy
      extends Object
      implements ActionProxy

  Mock for an `ActionProxy`.
  Author:
    Patrick Lightbody (plightbo at gmail dot com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.opensymphony.xwork2.ActionProxy

      `ActionProxy.LegacyAdapter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockActionProxy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `execute()` Execute this ActionProxy.
    `Object` | `getAction()` Gets the Action instance for this Proxy.
    `String` | `getActionName()` Gets the alias name this ActionProxy is mapped to.
    `ActionConfig` | `getConfig()` Gets the ActionConfig this ActionProxy is built from.
    `boolean` | `getExecuteResult()` Gets the status of whether the ActionProxy is set to execute the Result after the Action is executed.
    `ActionInvocation` | `getInvocation()`
    `String` | `getMethod()` Gets the method name to execute, or `null` if no method has been specified (meaning `execute` will be invoked).
    `String` | `getNamespace()` Gets the namespace the ActionConfig for this ActionProxy is mapped to.
    `boolean` | `isExecutedCalled()`
    `boolean` | `isMethodSpecified()` Gets status of the method value's initialization.
    `void` | `prepare()`
    `void` | `setAction(Object action)`
    `void` | `setActionName(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(String method)`
    `void` | `setMethodSpecified(boolean methodSpecified)`
    `void` | `setNamespace(String namespace)`
    `void` | `setReturnedResult(String returnedResult)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.opensymphony.xwork2.ActionProxy

      `adapt`

- - ### Constructor Detail

    - #### MockActionProxy

          public MockActionProxy()

  - ### Method Detail

    - #### prepare

          public void prepare()
                       throws Exception

      Throws:
        `Exception`

    - #### execute

          public String execute()
                         throws 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:
        `Exception` - can be thrown.
      See Also:
        `ActionInvocation`

    - #### setReturnedResult

          public void setReturnedResult(String returnedResult)

    - #### isExecutedCalled

          public boolean isExecutedCalled()

    - #### getAction

          public Object getAction()

      Description copied from interface: `ActionProxy`
      Gets the Action instance for this Proxy.
      Specified by:
        `getAction` in interface `ActionProxy`
      Returns:
        the Action instance

    - #### setAction

          public void setAction(Object action)

    - #### getActionName

          public String getActionName()

      Description copied from interface: `ActionProxy`
      Gets the alias name this ActionProxy is mapped to.
      Specified by:
        `getActionName` in interface `ActionProxy`
      Returns:
        the alias name

    - #### setActionName

          public void setActionName(String actionName)

    - #### getConfig

          public ActionConfig getConfig()

      Description copied from interface: `ActionProxy`
      Gets the ActionConfig this ActionProxy is built from.
      Specified by:
        `getConfig` in interface `ActionProxy`
      Returns:
        the ActionConfig

    - #### setConfig

          public void setConfig(ActionConfig config)

    - #### getExecuteResult

          public boolean getExecuteResult()

      Description copied from interface: `ActionProxy`
      Gets the status of whether the ActionProxy is set to execute the Result after the Action is executed.
      Specified by:
        `getExecuteResult` in interface `ActionProxy`
      Returns:
        the status

    - #### 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`
      Parameters:
        `executeResult` - `true` to also execute the Result.

    - #### getInvocation

          public ActionInvocation getInvocation()

      Specified by:
        `getInvocation` in interface `ActionProxy`

    - #### setInvocation

          public void setInvocation(ActionInvocation invocation)

    - #### getNamespace

          public String getNamespace()

      Description copied from interface: `ActionProxy`
      Gets the namespace the ActionConfig for this ActionProxy is mapped to.
      Specified by:
        `getNamespace` in interface `ActionProxy`
      Returns:
        the namespace

    - #### setNamespace

          public void setNamespace(String namespace)

    - #### getMethod

          public String getMethod()

      Description copied from interface: `ActionProxy`
      Gets the method name to execute, or `null` if no method has been specified (meaning `execute` will be invoked).
      Specified by:
        `getMethod` in interface `ActionProxy`
      Returns:
        the method to execute

    - #### setMethod

          public void setMethod(String method)

    - #### isMethodSpecified

          public boolean isMethodSpecified()

      Description copied from interface: `ActionProxy`
      Gets status of the method value's initialization. Returns `true` when the method was explicitly provided (e.g. via URL parameter, wildcard substitution, or action configuration), and `false` only when the framework defaults to `"execute"` because no method was specified anywhere.
      Specified by:
        `isMethodSpecified` in interface `ActionProxy`
      Returns:
        true if the method returned by getMethod() is not the default "execute" fallback.

    - #### setMethodSpecified

          public void setMethodSpecified(boolean methodSpecified)

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.