This project has retired. For details please refer to its Attic page.
MockHttpServletRequest xref
View Javadoc
1   /*
2    * Copyright 2013 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.juddi.auth;
17  
18  import java.io.BufferedReader;
19  import java.io.IOException;
20  import java.io.UnsupportedEncodingException;
21  import java.security.Principal;
22  import java.util.Enumeration;
23  import java.util.Locale;
24  import java.util.Map;
25  import javax.servlet.RequestDispatcher;
26  import javax.servlet.ServletInputStream;
27  import javax.servlet.http.Cookie;
28  import javax.servlet.http.HttpServletRequest;
29  import javax.servlet.http.HttpSession;
30  
31  /**
32   *
33   * @author Alex O'Ree
34   */
35  public class MockHttpServletRequest implements HttpServletRequest {
36  
37      String ip = null;
38  
39      public MockHttpServletRequest(String ip) {
40  
41          this.ip = ip;
42      }
43  
44      @Override
45      public String getAuthType() {
46          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
47      }
48  
49      @Override
50      public Cookie[] getCookies() {
51          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
52      }
53  
54      @Override
55      public long getDateHeader(String string) {
56          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
57      }
58  
59      @Override
60      public String getHeader(String string) {
61          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
62      }
63  
64      @Override
65      public Enumeration getHeaders(String string) {
66          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
67      }
68  
69      @Override
70      public Enumeration getHeaderNames() {
71          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
72      }
73  
74      @Override
75      public int getIntHeader(String string) {
76          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
77      }
78  
79      @Override
80      public String getMethod() {
81          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
82      }
83  
84      @Override
85      public String getPathInfo() {
86          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
87      }
88  
89      @Override
90      public String getPathTranslated() {
91          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
92      }
93  
94      @Override
95      public String getContextPath() {
96          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
97      }
98  
99      @Override
100     public String getQueryString() {
101         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
102     }
103 
104     @Override
105     public String getRemoteUser() {
106         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
107     }
108 
109     @Override
110     public boolean isUserInRole(String string) {
111         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
112     }
113 
114     @Override
115     public Principal getUserPrincipal() {
116         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
117     }
118 
119     @Override
120     public String getRequestedSessionId() {
121         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
122     }
123 
124     @Override
125     public String getRequestURI() {
126         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
127     }
128 
129     @Override
130     public StringBuffer getRequestURL() {
131         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
132     }
133 
134     @Override
135     public String getServletPath() {
136         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
137     }
138 
139     @Override
140     public HttpSession getSession(boolean bln) {
141         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
142     }
143 
144     @Override
145     public HttpSession getSession() {
146         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
147     }
148 
149     @Override
150     public boolean isRequestedSessionIdValid() {
151         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
152     }
153 
154     @Override
155     public boolean isRequestedSessionIdFromCookie() {
156         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
157     }
158 
159     @Override
160     public boolean isRequestedSessionIdFromURL() {
161         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
162     }
163 
164     @Override
165     public boolean isRequestedSessionIdFromUrl() {
166         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
167     }
168 
169     @Override
170     public Object getAttribute(String string) {
171         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
172     }
173 
174     @Override
175     public Enumeration getAttributeNames() {
176         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
177     }
178 
179     @Override
180     public String getCharacterEncoding() {
181         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
182     }
183 
184     @Override
185     public void setCharacterEncoding(String string) throws UnsupportedEncodingException {
186         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
187     }
188 
189     @Override
190     public int getContentLength() {
191         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
192     }
193 
194     @Override
195     public String getContentType() {
196         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
197     }
198 
199     @Override
200     public ServletInputStream getInputStream() throws IOException {
201         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
202     }
203 
204     @Override
205     public String getParameter(String string) {
206         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
207     }
208 
209     @Override
210     public Enumeration getParameterNames() {
211         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
212     }
213 
214     @Override
215     public String[] getParameterValues(String string) {
216         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
217     }
218 
219     @Override
220     public Map getParameterMap() {
221         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
222     }
223 
224     @Override
225     public String getProtocol() {
226         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
227     }
228 
229     @Override
230     public String getScheme() {
231         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
232     }
233 
234     @Override
235     public String getServerName() {
236         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
237     }
238 
239     @Override
240     public int getServerPort() {
241         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
242     }
243 
244     @Override
245     public BufferedReader getReader() throws IOException {
246         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
247     }
248 
249     @Override
250     public String getRemoteAddr() {
251         return this.ip;
252     }
253 
254     @Override
255     public String getRemoteHost() {
256         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
257     }
258 
259     @Override
260     public void setAttribute(String string, Object o) {
261         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
262     }
263 
264     @Override
265     public void removeAttribute(String string) {
266         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
267     }
268 
269     @Override
270     public Locale getLocale() {
271         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
272     }
273 
274     @Override
275     public Enumeration getLocales() {
276         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
277     }
278 
279     @Override
280     public boolean isSecure() {
281         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
282     }
283 
284     @Override
285     public RequestDispatcher getRequestDispatcher(String string) {
286         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
287     }
288 
289     @Override
290     public String getRealPath(String string) {
291         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
292     }
293 
294     @Override
295     public int getRemotePort() {
296         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
297     }
298 
299     @Override
300     public String getLocalName() {
301         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
302     }
303 
304     @Override
305     public String getLocalAddr() {
306         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
307     }
308 
309     @Override
310     public int getLocalPort() {
311         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
312     }
313 }