001: /*
002: * Copyright 1999-2004 The Apache Software Foundation
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.apache.commons.chain.web.servlet;
017:
018: import javax.servlet.ServletOutputStream;
019: import javax.servlet.http.Cookie;
020: import javax.servlet.http.HttpServletResponse;
021: import java.io.IOException;
022: import java.io.PrintWriter;
023: import java.util.Locale;
024:
025: // Mock Object for HttpServletResponse (Version 2.3)
026: public class MockHttpServletResponse implements HttpServletResponse {
027:
028: // ------------------------------------------------------ Instance Variables
029:
030: private Locale locale = null;
031:
032: // ---------------------------------------------------------- Public Methods
033:
034: // --------------------------------------------- HttpServletResponse Methods
035:
036: public void addCookie(Cookie cookie) {
037: throw new UnsupportedOperationException();
038: }
039:
040: public void addDateHeader(String name, long value) {
041: throw new UnsupportedOperationException();
042: }
043:
044: public void addHeader(String name, String value) {
045: throw new UnsupportedOperationException();
046: }
047:
048: public void addIntHeader(String name, int value) {
049: throw new UnsupportedOperationException();
050: }
051:
052: public boolean containsHeader(String name) {
053: throw new UnsupportedOperationException();
054: }
055:
056: public String encodeRedirectUrl(String url) {
057: return (encodeRedirectURL(url));
058: }
059:
060: public String encodeRedirectURL(String url) {
061: return (url);
062: }
063:
064: public String encodeUrl(String url) {
065: return (encodeURL(url));
066: }
067:
068: public String encodeURL(String url) {
069: return (url);
070: }
071:
072: public void sendError(int status) {
073: throw new UnsupportedOperationException();
074: }
075:
076: public void sendError(int status, String message) {
077: throw new UnsupportedOperationException();
078: }
079:
080: public void sendRedirect(String location) {
081: throw new UnsupportedOperationException();
082: }
083:
084: public void setDateHeader(String name, long value) {
085: throw new UnsupportedOperationException();
086: }
087:
088: public void setHeader(String name, String value) {
089: throw new UnsupportedOperationException();
090: }
091:
092: public void setIntHeader(String name, int value) {
093: throw new UnsupportedOperationException();
094: }
095:
096: public void setStatus(int status) {
097: throw new UnsupportedOperationException();
098: }
099:
100: public void setStatus(int status, String message) {
101: throw new UnsupportedOperationException();
102: }
103:
104: // ------------------------------------------------- ServletResponse Methods
105:
106: public void flushBuffer() {
107: throw new UnsupportedOperationException();
108: }
109:
110: public int getBufferSize() {
111: throw new UnsupportedOperationException();
112: }
113:
114: public String getCharacterEncoding() {
115: throw new UnsupportedOperationException();
116: }
117:
118: public String getContentType() {
119: throw new UnsupportedOperationException();
120: }
121:
122: public Locale getLocale() {
123: return (this .locale);
124: }
125:
126: public ServletOutputStream getOutputStream() throws IOException {
127: throw new UnsupportedOperationException();
128: }
129:
130: public PrintWriter getWriter() throws IOException {
131: throw new UnsupportedOperationException();
132: }
133:
134: public boolean isCommitted() {
135: throw new UnsupportedOperationException();
136: }
137:
138: public void reset() {
139: throw new UnsupportedOperationException();
140: }
141:
142: public void resetBuffer() {
143: throw new UnsupportedOperationException();
144: }
145:
146: public void setBufferSize(int size) {
147: throw new UnsupportedOperationException();
148: }
149:
150: public void setCharacterEncoding(String encoding) {
151: throw new UnsupportedOperationException();
152: }
153:
154: public void setContentLength(int length) {
155: throw new UnsupportedOperationException();
156: }
157:
158: public void setContentType(String type) {
159: throw new UnsupportedOperationException();
160: }
161:
162: public void setLocale(Locale locale) {
163: this.locale = locale;
164: }
165:
166: }
|