fc00a61eeaccf6dc778e86195c87ae33e3b43afc
[sdnc/apps.git] /
1 /*
2  *  ============LICENSE_START===================================================
3  * Copyright (c) 2018 Amdocs
4  * ============================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=====================================================
17  */
18
19 package org.onap.sdnc.apps.pomba.servicedecomposition.test;
20
21 import java.io.BufferedReader;
22 import java.io.IOException;
23 import java.io.UnsupportedEncodingException;
24 import java.security.Principal;
25 import java.util.Collection;
26 import java.util.Enumeration;
27 import java.util.Locale;
28 import java.util.Map;
29 import javax.servlet.AsyncContext;
30 import javax.servlet.DispatcherType;
31 import javax.servlet.RequestDispatcher;
32 import javax.servlet.ServletContext;
33 import javax.servlet.ServletException;
34 import javax.servlet.ServletInputStream;
35 import javax.servlet.ServletRequest;
36 import javax.servlet.ServletResponse;
37 import javax.servlet.http.Cookie;
38 import javax.servlet.http.HttpServletRequest;
39 import javax.servlet.http.HttpServletResponse;
40 import javax.servlet.http.HttpSession;
41 import javax.servlet.http.HttpUpgradeHandler;
42 import javax.servlet.http.Part;
43
44 public class TestHttpServletRequest implements HttpServletRequest {
45     @Override
46     public String getHeader(String name) {
47         return null;
48     }
49
50     @Override
51     public String getRemoteAddr() {
52         return "localhost";
53     }
54
55     @Override
56     public String getServerName() {
57         return "localhost";
58     }
59
60     @Override
61     public String getRequestURI() {
62         return "/test";
63     }
64
65
66     @Override
67     public Object getAttribute(String name) {
68         throw new UnsupportedOperationException("getAttribute");
69     }
70
71     @Override
72     public Enumeration<String> getAttributeNames() {
73         throw new UnsupportedOperationException("getAttributeNames");
74     }
75
76     @Override
77     public String getCharacterEncoding() {
78         throw new UnsupportedOperationException("getCharacterEncoding");
79     }
80
81     @Override
82     public void setCharacterEncoding(String env) throws UnsupportedEncodingException {
83         throw new UnsupportedOperationException("setCharacterEncoding");
84     }
85
86     @Override
87     public int getContentLength() {
88         throw new UnsupportedOperationException("getContentLength");
89     }
90
91     @Override
92     public long getContentLengthLong() {
93         throw new UnsupportedOperationException("getContentLengthLong");
94     }
95
96     @Override
97     public String getContentType() {
98         throw new UnsupportedOperationException("getContentType");
99     }
100
101     @Override
102     public ServletInputStream getInputStream() throws IOException {
103         throw new UnsupportedOperationException("getInputStream");
104     }
105
106     @Override
107     public String getParameter(String name) {
108         throw new UnsupportedOperationException("getParameter");
109     }
110
111     @Override
112     public Enumeration<String> getParameterNames() {
113         throw new UnsupportedOperationException("getParameterNames");
114     }
115
116     @Override
117     public String[] getParameterValues(String name) {
118         throw new UnsupportedOperationException("getParameterValues");
119     }
120
121     @Override
122     public Map<String, String[]> getParameterMap() {
123         throw new UnsupportedOperationException("getParameterMap");
124     }
125
126     @Override
127     public String getProtocol() {
128         throw new UnsupportedOperationException("getProtocol");
129     }
130
131     @Override
132     public String getScheme() {
133         throw new UnsupportedOperationException("getScheme");
134     }
135
136     @Override
137     public int getServerPort() {
138         throw new UnsupportedOperationException("getServerPort");
139     }
140
141     @Override
142     public BufferedReader getReader() throws IOException {
143         throw new UnsupportedOperationException("getReader");
144     }
145
146     @Override
147     public String getRemoteHost() {
148         throw new UnsupportedOperationException("getRemoteHost");
149     }
150
151     @Override
152     public void setAttribute(String name, Object obj) {
153         throw new UnsupportedOperationException("setAttribute");
154     }
155
156     @Override
157     public void removeAttribute(String name) {
158         throw new UnsupportedOperationException("removeAttribute");
159     }
160
161     @Override
162     public Locale getLocale() {
163         throw new UnsupportedOperationException("getLocale");
164     }
165
166     @Override
167     public Enumeration<Locale> getLocales() {
168         throw new UnsupportedOperationException("getLocales");
169     }
170
171     @Override
172     public boolean isSecure() {
173         throw new UnsupportedOperationException("isSecure");
174     }
175
176     @Override
177     public RequestDispatcher getRequestDispatcher(String path) {
178         throw new UnsupportedOperationException("getRequestDispatcher");
179     }
180
181     @Override
182     public String getRealPath(String path) {
183         throw new UnsupportedOperationException("getRealPath");
184     }
185
186     @Override
187     public int getRemotePort() {
188         throw new UnsupportedOperationException("getRemotePort");
189     }
190
191     @Override
192     public String getLocalName() {
193         throw new UnsupportedOperationException("getLocalName");
194     }
195
196     @Override
197     public String getLocalAddr() {
198         throw new UnsupportedOperationException("getLocalAddr");
199     }
200
201     @Override
202     public int getLocalPort() {
203         throw new UnsupportedOperationException("getLocalPort");
204     }
205
206     @Override
207     public ServletContext getServletContext() {
208         throw new UnsupportedOperationException("getServletContext");
209     }
210
211     @Override
212     public AsyncContext startAsync() throws IllegalStateException {
213         throw new UnsupportedOperationException("startAsync");
214     }
215
216     @Override
217     public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
218             throws IllegalStateException {
219         throw new UnsupportedOperationException("startAsync");
220     }
221
222     @Override
223     public boolean isAsyncStarted() {
224         throw new UnsupportedOperationException("isAsyncStarted");
225     }
226
227     @Override
228     public boolean isAsyncSupported() {
229         throw new UnsupportedOperationException("isAsyncSupported");
230     }
231
232     @Override
233     public AsyncContext getAsyncContext() {
234         throw new UnsupportedOperationException("getAsyncContext");
235     }
236
237     @Override
238     public DispatcherType getDispatcherType() {
239         throw new UnsupportedOperationException("getDispatcherType");
240     }
241
242     @Override
243     public String getAuthType() {
244         throw new UnsupportedOperationException("getAuthType");
245     }
246
247     @Override
248     public Cookie[] getCookies() {
249         throw new UnsupportedOperationException("getCookies");
250     }
251
252     @Override
253     public long getDateHeader(String name) {
254         throw new UnsupportedOperationException("getDateHeader");
255     }
256
257     @Override
258     public Enumeration<String> getHeaders(String name) {
259         throw new UnsupportedOperationException("getHeaders");
260     }
261
262     @Override
263     public Enumeration<String> getHeaderNames() {
264         throw new UnsupportedOperationException("getHeaderNames");
265     }
266
267     @Override
268     public int getIntHeader(String name) {
269         throw new UnsupportedOperationException("getIntHeader");
270     }
271
272     @Override
273     public String getMethod() {
274         throw new UnsupportedOperationException("getMethod");
275     }
276
277     @Override
278     public String getPathInfo() {
279         throw new UnsupportedOperationException("getPathInfo");
280     }
281
282     @Override
283     public String getPathTranslated() {
284         throw new UnsupportedOperationException("getPathTranslated");
285     }
286
287     @Override
288     public String getContextPath() {
289         throw new UnsupportedOperationException("getContextPath");
290     }
291
292     @Override
293     public String getQueryString() {
294         throw new UnsupportedOperationException("getQueryString");
295     }
296
297     @Override
298     public String getRemoteUser() {
299         throw new UnsupportedOperationException("getRemoteUser");
300     }
301
302     @Override
303     public boolean isUserInRole(String role) {
304         throw new UnsupportedOperationException("isUserInRole");
305     }
306
307     @Override
308     public Principal getUserPrincipal() {
309         throw new UnsupportedOperationException("getUserPrincipal");
310     }
311
312     @Override
313     public String getRequestedSessionId() {
314         throw new UnsupportedOperationException("getRequestedSessionId");
315     }
316
317     @Override
318     public StringBuffer getRequestURL() {
319         throw new UnsupportedOperationException("getRequestURL");
320     }
321
322     @Override
323     public String getServletPath() {
324         throw new UnsupportedOperationException("getServletPath");
325     }
326
327     @Override
328     public HttpSession getSession(boolean create) {
329         throw new UnsupportedOperationException("getSession");
330     }
331
332     @Override
333     public HttpSession getSession() {
334         throw new UnsupportedOperationException("getSession");
335     }
336
337     @Override
338     public String changeSessionId() {
339         throw new UnsupportedOperationException("changeSessionId");
340     }
341
342     @Override
343     public boolean isRequestedSessionIdValid() {
344         throw new UnsupportedOperationException("isRequestedSessionIdValid");
345     }
346
347     @Override
348     public boolean isRequestedSessionIdFromCookie() {
349         throw new UnsupportedOperationException("isRequestedSessionIdFromCookie");
350     }
351
352     @Override
353     public boolean isRequestedSessionIdFromURL() {
354         throw new UnsupportedOperationException("isRequestedSessionIdFromURL");
355     }
356
357     @Override
358     public boolean isRequestedSessionIdFromUrl() {
359         throw new UnsupportedOperationException("isRequestedSessionIdFromUrl");
360     }
361
362     @Override
363     public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
364         throw new UnsupportedOperationException("authenticate");
365     }
366
367     @Override
368     public void login(String username, String password) throws ServletException {
369         throw new UnsupportedOperationException("login");
370     }
371
372     @Override
373     public void logout() throws ServletException {
374         throw new UnsupportedOperationException("logout");
375     }
376
377     @Override
378     public Collection<Part> getParts() throws IOException, ServletException {
379         throw new UnsupportedOperationException("getParts");
380     }
381
382     @Override
383     public Part getPart(String name) throws IOException, ServletException {
384         throw new UnsupportedOperationException("getPart");
385     }
386
387     @Override
388     public <T extends HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass)
389             throws IOException, ServletException {
390         throw new UnsupportedOperationException("upgrade");
391     }
392 }