View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.internal.mock.servlet;
21  
22  import javax.servlet.ServletOutputStream;
23  import javax.servlet.http.Cookie;
24  import javax.servlet.http.HttpServletResponse;
25  import java.io.IOException;
26  import java.io.PrintWriter;
27  import java.util.Locale;
28  
29  public class MockHttpServletResponse implements HttpServletResponse {
30  
31    public void addCookie(final Cookie cookie) {
32    }
33  
34    public void addDateHeader(final String s, final long l) {
35    }
36  
37    public void addHeader(final String s, final String s1) {
38    }
39  
40    public void addIntHeader(final String s, final int i) {
41    }
42  
43    public boolean containsHeader(final String s) {
44      return false;
45    }
46  
47    public String encodeRedirectURL(final String s) {
48      return null;
49    }
50  
51    /** @deprecated */
52    public String encodeRedirectUrl(final String s) {
53      return null;
54    }
55  
56    public String encodeURL(final String s) {
57      return s;
58    }
59  
60    /** @deprecated */
61    public String encodeUrl(final String s) {
62      return s;
63    }
64  
65    public void flushBuffer() throws IOException {
66    }
67  
68    public int getBufferSize() {
69      return 0;
70    }
71  
72    public String getCharacterEncoding() {
73      return null;
74    }
75  
76    public Locale getLocale() {
77      return null;
78    }
79  
80    public ServletOutputStream getOutputStream() throws IOException {
81      return null;
82    }
83  
84    public PrintWriter getWriter() throws IOException {
85      return null;
86    }
87  
88    public boolean isCommitted() {
89      return false;
90    }
91  
92    public void reset() {
93    }
94  
95    public void resetBuffer() {
96    }
97  
98    public void sendError(final int i) throws IOException {
99    }
100 
101   public void sendError(final int i, final String s) throws IOException {
102   }
103 
104   public void sendRedirect(final String s) throws IOException {
105   }
106 
107   public void setBufferSize(final int i) {
108   }
109 
110   public void setContentLength(final int i) {
111   }
112 
113   public void setContentType(final String s) {
114   }
115 
116   public void setDateHeader(final String s, final long l) {
117   }
118 
119   public void setHeader(final String s, final String s1) {
120   }
121 
122   public void setIntHeader(final String s, final int i) {
123   }
124 
125   public void setLocale(final Locale locale) {
126   }
127 
128   /** @deprecated */
129   public void setStatus(final int i) {
130   }
131 
132   public void setStatus(final int i, final String s) {
133   }
134 
135   public String getContentType() {
136     return null;
137   }
138 
139   public void setCharacterEncoding(final String reference) {
140   }
141 }