2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.test.mock;
19
20 import java.io.IOException;
21
22 import javax.servlet.Servlet;
23 import javax.servlet.ServletConfig;
24 import javax.servlet.ServletException;
25 import javax.servlet.ServletRequest;
26 import javax.servlet.ServletResponse;
27
28 /***
29 * <p>Mock implementation of <code>Servlet</code>.</p>
30 *
31 * $Id$
32 */
33
34 public class MockServlet implements Servlet {
35
36
37
38
39
40 /***
41 * <p>Create a default Servlet instance.</p>
42 */
43 public MockServlet() {
44 }
45
46
47 /***
48 * <p>Create a new Servlet with the specified ServletConfig.</p>
49 *
50 * @param config The new ServletConfig instance
51 */
52 public MockServlet(ServletConfig config) throws ServletException {
53 init(config);
54 }
55
56
57
58
59
60 /***
61 * <p>Set the <code>ServletConfig</code> instance for this servlet.</p>
62 *
63 * @param config The new ServletConfig instance
64 */
65 public void setServletConfig(ServletConfig config) {
66
67 this.config = config;
68
69 }
70
71
72
73
74
75 /***
76 * <p>The <code>ServletConfig</code> instance for this servlet.</p>
77 */
78 private ServletConfig config;
79
80
81
82
83
84 /*** {@inheritDoc} */
85 public void destroy() {
86 }
87
88
89 /*** {@inheritDoc} */
90 public ServletConfig getServletConfig() {
91
92 return this.config;
93
94 }
95
96
97 /*** {@inheritDoc} */
98 public String getServletInfo() {
99
100 return "MockServlet";
101
102 }
103
104
105 /*** {@inheritDoc} */
106 public void init(ServletConfig config) throws ServletException {
107
108 this.config = config;
109
110 }
111
112
113 /*** {@inheritDoc} */
114 public void service(ServletRequest request, ServletResponse response)
115 throws IOException, ServletException {
116
117
118
119 }
120
121
122 }