01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05:
06: package com.opensymphony.xwork.mock;
07:
08: import com.opensymphony.xwork.config.entities.ActionConfig;
09: import com.opensymphony.xwork.ActionProxy;
10: import com.opensymphony.xwork.ActionInvocation;
11:
12: /**
13: * Mock for an {@link ActionProxy}.
14: *
15: * @author Patrick Lightbody (plightbo at gmail dot com)
16: */
17: public class MockActionProxy implements ActionProxy {
18:
19: Object action;
20: String actionName;
21: ActionConfig config;
22: boolean executeResult;
23: ActionInvocation invocation;
24: String namespace;
25: String method;
26: boolean executedCalled;
27: String returnedResult;
28:
29: public String execute() throws Exception {
30: executedCalled = true;
31:
32: return returnedResult;
33: }
34:
35: public void setReturnedResult(String returnedResult) {
36: this .returnedResult = returnedResult;
37: }
38:
39: public boolean isExecutedCalled() {
40: return executedCalled;
41: }
42:
43: public Object getAction() {
44: return action;
45: }
46:
47: public void setAction(Object action) {
48: this .action = action;
49: }
50:
51: public String getActionName() {
52: return actionName;
53: }
54:
55: public void setActionName(String actionName) {
56: this .actionName = actionName;
57: }
58:
59: public ActionConfig getConfig() {
60: return config;
61: }
62:
63: public void setConfig(ActionConfig config) {
64: this .config = config;
65: }
66:
67: public boolean getExecuteResult() {
68: return executeResult;
69: }
70:
71: public void setExecuteResult(boolean executeResult) {
72: this .executeResult = executeResult;
73: }
74:
75: public ActionInvocation getInvocation() {
76: return invocation;
77: }
78:
79: public void setInvocation(ActionInvocation invocation) {
80: this .invocation = invocation;
81: }
82:
83: public String getNamespace() {
84: return namespace;
85: }
86:
87: public void setNamespace(String namespace) {
88: this .namespace = namespace;
89: }
90:
91: public String getMethod() {
92: return method;
93: }
94:
95: public void setMethod(String method) {
96: this.method = method;
97: }
98: }
|