KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > chain > web > servlet > MockHttpServletResponse


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.chain.web.servlet;
17
18
19 import javax.servlet.ServletOutputStream JavaDoc;
20 import javax.servlet.http.Cookie JavaDoc;
21 import javax.servlet.http.HttpServletResponse JavaDoc;
22 import java.io.IOException JavaDoc;
23 import java.io.PrintWriter JavaDoc;
24 import java.util.Locale JavaDoc;
25
26
27
28 // Mock Object for HttpServletResponse (Version 2.3)
29
public class MockHttpServletResponse implements HttpServletResponse JavaDoc {
30
31
32
33     // ------------------------------------------------------ Instance Variables
34

35
36     private Locale JavaDoc locale = null;
37
38
39     // ---------------------------------------------------------- Public Methods
40

41
42     // --------------------------------------------- HttpServletResponse Methods
43

44
45     public void addCookie(Cookie JavaDoc cookie) {
46         throw new UnsupportedOperationException JavaDoc();
47     }
48
49
50     public void addDateHeader(String JavaDoc name, long value) {
51         throw new UnsupportedOperationException JavaDoc();
52     }
53
54
55     public void addHeader(String JavaDoc name, String JavaDoc value) {
56         throw new UnsupportedOperationException JavaDoc();
57     }
58
59
60     public void addIntHeader(String JavaDoc name, int value) {
61         throw new UnsupportedOperationException JavaDoc();
62     }
63
64
65     public boolean containsHeader(String JavaDoc name) {
66         throw new UnsupportedOperationException JavaDoc();
67     }
68
69
70     public String JavaDoc encodeRedirectUrl(String JavaDoc url) {
71         return (encodeRedirectURL(url));
72     }
73
74
75     public String JavaDoc encodeRedirectURL(String JavaDoc url) {
76         return (url);
77     }
78
79
80     public String JavaDoc encodeUrl(String JavaDoc url) {
81         return (encodeURL(url));
82     }
83
84
85     public String JavaDoc encodeURL(String JavaDoc url) {
86         return (url);
87     }
88
89
90     public void sendError(int status) {
91         throw new UnsupportedOperationException JavaDoc();
92     }
93
94
95     public void sendError(int status, String JavaDoc message) {
96         throw new UnsupportedOperationException JavaDoc();
97     }
98
99
100     public void sendRedirect(String JavaDoc location) {
101         throw new UnsupportedOperationException JavaDoc();
102     }
103
104
105     public void setDateHeader(String JavaDoc name, long value) {
106         throw new UnsupportedOperationException JavaDoc();
107     }
108
109
110     public void setHeader(String JavaDoc name, String JavaDoc value) {
111         throw new UnsupportedOperationException JavaDoc();
112     }
113
114
115     public void setIntHeader(String JavaDoc name, int value) {
116         throw new UnsupportedOperationException JavaDoc();
117     }
118
119
120     public void setStatus(int status) {
121         throw new UnsupportedOperationException JavaDoc();
122     }
123
124
125     public void setStatus(int status, String JavaDoc message) {
126         throw new UnsupportedOperationException JavaDoc();
127     }
128
129
130     // ------------------------------------------------- ServletResponse Methods
131

132
133     public void flushBuffer() {
134         throw new UnsupportedOperationException JavaDoc();
135     }
136
137
138     public int getBufferSize() {
139         throw new UnsupportedOperationException JavaDoc();
140     }
141
142
143     public String JavaDoc getCharacterEncoding() {
144         throw new UnsupportedOperationException JavaDoc();
145     }
146
147
148     public String JavaDoc getContentType() {
149     throw new UnsupportedOperationException JavaDoc();
150     }
151
152
153     public Locale JavaDoc getLocale() {
154         return (this.locale);
155     }
156
157
158     public ServletOutputStream JavaDoc getOutputStream() throws IOException JavaDoc {
159         throw new UnsupportedOperationException JavaDoc();
160     }
161
162
163     public PrintWriter JavaDoc getWriter() throws IOException JavaDoc {
164         throw new UnsupportedOperationException JavaDoc();
165     }
166
167
168     public boolean isCommitted() {
169         throw new UnsupportedOperationException JavaDoc();
170     }
171
172
173     public void reset() {
174         throw new UnsupportedOperationException JavaDoc();
175     }
176
177
178     public void resetBuffer() {
179         throw new UnsupportedOperationException JavaDoc();
180     }
181
182
183     public void setBufferSize(int size) {
184         throw new UnsupportedOperationException JavaDoc();
185     }
186
187
188     public void setCharacterEncoding(String JavaDoc encoding) {
189     throw new UnsupportedOperationException JavaDoc();
190     }
191
192
193     public void setContentLength(int length) {
194         throw new UnsupportedOperationException JavaDoc();
195     }
196
197
198     public void setContentType(String JavaDoc type) {
199         throw new UnsupportedOperationException JavaDoc();
200     }
201
202
203     public void setLocale(Locale JavaDoc locale) {
204     this.locale = locale;
205     }
206
207
208 }
209
Popular Tags