01: /*
02: * Copyright 2005-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
05: * in compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License
10: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11: * or implied. See the License for the specific language governing permissions and limitations under
12: * the License.
13: */
14:
15: package org.strecks.context.impl;
16:
17: import javax.servlet.ServletContext;
18: import javax.servlet.http.HttpServletRequest;
19: import javax.servlet.http.HttpServletResponse;
20:
21: import org.apache.struts.action.ActionForm;
22: import org.apache.struts.action.ActionMapping;
23: import org.strecks.context.ActionContext;
24:
25: /**
26: * @author Phil Zoio
27: */
28: public class TestContextImpl implements ActionContext {
29:
30: private HttpServletRequest request;
31:
32: private HttpServletResponse response;
33:
34: private ServletContext context;
35:
36: private ActionForm form;
37:
38: private ActionMapping mapping;
39:
40: public TestContextImpl(HttpServletRequest request) {
41: super ();
42: this .request = request;
43: }
44:
45: public TestContextImpl() {
46: super ();
47: }
48:
49: public TestContextImpl(ActionForm form, ActionMapping mapping) {
50: super ();
51: this .form = form;
52: this .mapping = mapping;
53: }
54:
55: public TestContextImpl(ServletContext context) {
56: super ();
57: this .context = context;
58: }
59:
60: public TestContextImpl(HttpServletRequest request,
61: HttpServletResponse response, ServletContext context,
62: ActionForm form, ActionMapping mapping) {
63: super ();
64: this .request = request;
65: this .response = response;
66: this .context = context;
67: this .form = form;
68: this .mapping = mapping;
69: }
70:
71: public ServletContext getContext() {
72: return context;
73: }
74:
75: public ActionForm getForm() {
76: return form;
77: }
78:
79: public ActionMapping getMapping() {
80: return mapping;
81: }
82:
83: public HttpServletRequest getRequest() {
84: return request;
85: }
86:
87: public HttpServletResponse getResponse() {
88: return response;
89: }
90:
91: @Override
92: public boolean equals(Object obj) {
93: return super.equals(obj);
94: }
95:
96: }
|