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
9 * http://www.apache.org/licenses/LICENSE-2.0
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=====================================================
18 package org.onap.sdnc.apps.pomba.networkdiscovery.unittest.service;
20 import java.io.BufferedReader;
21 import java.io.IOException;
22 import java.io.UnsupportedEncodingException;
23 import java.security.Principal;
24 import java.util.Collection;
25 import java.util.Enumeration;
26 import java.util.Locale;
28 import javax.servlet.AsyncContext;
29 import javax.servlet.DispatcherType;
30 import javax.servlet.RequestDispatcher;
31 import javax.servlet.ServletContext;
32 import javax.servlet.ServletException;
33 import javax.servlet.ServletInputStream;
34 import javax.servlet.ServletRequest;
35 import javax.servlet.ServletResponse;
36 import javax.servlet.http.Cookie;
37 import javax.servlet.http.HttpServletRequest;
38 import javax.servlet.http.HttpServletResponse;
39 import javax.servlet.http.HttpSession;
40 import javax.servlet.http.HttpUpgradeHandler;
41 import javax.servlet.http.Part;
43 public class TestHttpServletRequest implements HttpServletRequest {
45 public String getHeader(String name) {
50 public String getRemoteAddr() {
55 public String getServerName() {
60 public String getRequestURI() {
66 public Object getAttribute(String name) {
67 // TODO Implement getAttribute
68 throw new UnsupportedOperationException("getAttribute");
72 public Enumeration<String> getAttributeNames() {
73 // TODO Implement getAttributeNames
74 throw new UnsupportedOperationException("getAttributeNames");
78 public String getCharacterEncoding() {
79 // TODO Implement getCharacterEncoding
80 throw new UnsupportedOperationException("getCharacterEncoding");
84 public void setCharacterEncoding(String env) throws UnsupportedEncodingException {
85 // TODO Implement setCharacterEncoding
86 throw new UnsupportedOperationException("setCharacterEncoding");
90 public int getContentLength() {
91 // TODO Implement getContentLength
92 throw new UnsupportedOperationException("getContentLength");
96 public long getContentLengthLong() {
97 // TODO Implement getContentLengthLong
98 throw new UnsupportedOperationException("getContentLengthLong");
102 public String getContentType() {
103 // TODO Implement getContentType
104 throw new UnsupportedOperationException("getContentType");
108 public ServletInputStream getInputStream() throws IOException {
109 // TODO Implement getInputStream
110 throw new UnsupportedOperationException("getInputStream");
114 public String getParameter(String name) {
115 // TODO Implement getParameter
116 throw new UnsupportedOperationException("getParameter");
120 public Enumeration<String> getParameterNames() {
121 // TODO Implement getParameterNames
122 throw new UnsupportedOperationException("getParameterNames");
126 public String[] getParameterValues(String name) {
127 // TODO Implement getParameterValues
128 throw new UnsupportedOperationException("getParameterValues");
132 public Map<String, String[]> getParameterMap() {
133 // TODO Implement getParameterMap
134 throw new UnsupportedOperationException("getParameterMap");
138 public String getProtocol() {
139 // TODO Implement getProtocol
140 throw new UnsupportedOperationException("getProtocol");
144 public String getScheme() {
145 // TODO Implement getScheme
146 throw new UnsupportedOperationException("getScheme");
150 public int getServerPort() {
151 // TODO Implement getServerPort
152 throw new UnsupportedOperationException("getServerPort");
156 public BufferedReader getReader() throws IOException {
157 // TODO Implement getReader
158 throw new UnsupportedOperationException("getReader");
162 public String getRemoteHost() {
163 // TODO Implement getRemoteHost
164 throw new UnsupportedOperationException("getRemoteHost");
168 public void setAttribute(String name, Object obj) {
169 // TODO Implement setAttribute
170 throw new UnsupportedOperationException("setAttribute");
174 public void removeAttribute(String name) {
175 // TODO Implement removeAttribute
176 throw new UnsupportedOperationException("removeAttribute");
180 public Locale getLocale() {
181 // TODO Implement getLocale
182 throw new UnsupportedOperationException("getLocale");
186 public Enumeration<Locale> getLocales() {
187 // TODO Implement getLocales
188 throw new UnsupportedOperationException("getLocales");
192 public boolean isSecure() {
193 // TODO Implement isSecure
194 throw new UnsupportedOperationException("isSecure");
198 public RequestDispatcher getRequestDispatcher(String path) {
199 // TODO Implement getRequestDispatcher
200 throw new UnsupportedOperationException("getRequestDispatcher");
204 public String getRealPath(String path) {
205 // TODO Implement getRealPath
206 throw new UnsupportedOperationException("getRealPath");
210 public int getRemotePort() {
211 // TODO Implement getRemotePort
212 throw new UnsupportedOperationException("getRemotePort");
216 public String getLocalName() {
217 // TODO Implement getLocalName
218 throw new UnsupportedOperationException("getLocalName");
222 public String getLocalAddr() {
223 // TODO Implement getLocalAddr
224 throw new UnsupportedOperationException("getLocalAddr");
228 public int getLocalPort() {
229 // TODO Implement getLocalPort
230 throw new UnsupportedOperationException("getLocalPort");
234 public ServletContext getServletContext() {
235 // TODO Implement getServletContext
236 throw new UnsupportedOperationException("getServletContext");
240 public AsyncContext startAsync() throws IllegalStateException {
241 // TODO Implement startAsync
242 throw new UnsupportedOperationException("startAsync");
246 public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
247 throws IllegalStateException {
248 // TODO Implement startAsync
249 throw new UnsupportedOperationException("startAsync");
253 public boolean isAsyncStarted() {
254 // TODO Implement isAsyncStarted
255 throw new UnsupportedOperationException("isAsyncStarted");
259 public boolean isAsyncSupported() {
260 // TODO Implement isAsyncSupported
261 throw new UnsupportedOperationException("isAsyncSupported");
265 public AsyncContext getAsyncContext() {
266 // TODO Implement getAsyncContext
267 throw new UnsupportedOperationException("getAsyncContext");
271 public DispatcherType getDispatcherType() {
272 // TODO Implement getDispatcherType
273 throw new UnsupportedOperationException("getDispatcherType");
277 public String getAuthType() {
278 // TODO Implement getAuthType
279 throw new UnsupportedOperationException("getAuthType");
283 public Cookie[] getCookies() {
284 // TODO Implement getCookies
285 throw new UnsupportedOperationException("getCookies");
289 public long getDateHeader(String name) {
290 // TODO Implement getDateHeader
291 throw new UnsupportedOperationException("getDateHeader");
295 public Enumeration<String> getHeaders(String name) {
296 // TODO Implement getHeaders
297 throw new UnsupportedOperationException("getHeaders");
301 public Enumeration<String> getHeaderNames() {
302 // TODO Implement getHeaderNames
303 throw new UnsupportedOperationException("getHeaderNames");
307 public int getIntHeader(String name) {
308 // TODO Implement getIntHeader
309 throw new UnsupportedOperationException("getIntHeader");
313 public String getMethod() {
314 // TODO Implement getMethod
315 throw new UnsupportedOperationException("getMethod");
319 public String getPathInfo() {
320 // TODO Implement getPathInfo
321 throw new UnsupportedOperationException("getPathInfo");
325 public String getPathTranslated() {
326 // TODO Implement getPathTranslated
327 throw new UnsupportedOperationException("getPathTranslated");
331 public String getContextPath() {
332 // TODO Implement getContextPath
333 throw new UnsupportedOperationException("getContextPath");
337 public String getQueryString() {
338 // TODO Implement getQueryString
339 throw new UnsupportedOperationException("getQueryString");
343 public String getRemoteUser() {
344 // TODO Implement getRemoteUser
345 throw new UnsupportedOperationException("getRemoteUser");
349 public boolean isUserInRole(String role) {
350 // TODO Implement isUserInRole
351 throw new UnsupportedOperationException("isUserInRole");
355 public Principal getUserPrincipal() {
356 // TODO Implement getUserPrincipal
357 throw new UnsupportedOperationException("getUserPrincipal");
361 public String getRequestedSessionId() {
362 // TODO Implement getRequestedSessionId
363 throw new UnsupportedOperationException("getRequestedSessionId");
367 public StringBuffer getRequestURL() {
368 // TODO Implement getRequestURL
369 throw new UnsupportedOperationException("getRequestURL");
373 public String getServletPath() {
374 // TODO Implement getServletPath
375 throw new UnsupportedOperationException("getServletPath");
379 public HttpSession getSession(boolean create) {
380 // TODO Implement getSession
381 throw new UnsupportedOperationException("getSession");
385 public HttpSession getSession() {
386 // TODO Implement getSession
387 throw new UnsupportedOperationException("getSession");
391 public String changeSessionId() {
392 // TODO Implement changeSessionId
393 throw new UnsupportedOperationException("changeSessionId");
397 public boolean isRequestedSessionIdValid() {
398 // TODO Implement isRequestedSessionIdValid
399 throw new UnsupportedOperationException("isRequestedSessionIdValid");
403 public boolean isRequestedSessionIdFromCookie() {
404 // TODO Implement isRequestedSessionIdFromCookie
405 throw new UnsupportedOperationException("isRequestedSessionIdFromCookie");
409 public boolean isRequestedSessionIdFromURL() {
410 // TODO Implement isRequestedSessionIdFromURL
411 throw new UnsupportedOperationException("isRequestedSessionIdFromURL");
415 public boolean isRequestedSessionIdFromUrl() {
416 // TODO Implement isRequestedSessionIdFromUrl
417 throw new UnsupportedOperationException("isRequestedSessionIdFromUrl");
421 public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
422 // TODO Implement authenticate
423 throw new UnsupportedOperationException("authenticate");
427 public void login(String username, String password) throws ServletException {
428 // TODO Implement login
429 throw new UnsupportedOperationException("login");
433 public void logout() throws ServletException {
434 // TODO Implement logout
435 throw new UnsupportedOperationException("logout");
439 public Collection<Part> getParts() throws IOException, ServletException {
440 // TODO Implement getParts
441 throw new UnsupportedOperationException("getParts");
445 public Part getPart(String name) throws IOException, ServletException {
446 // TODO Implement getPart
447 throw new UnsupportedOperationException("getPart");
451 public <T extends HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass)
452 throws IOException, ServletException {
453 // TODO Implement upgrade
454 throw new UnsupportedOperationException("upgrade");
456 /////////////////////////////////////////////////////////////////////////////
458 /////////////////////////////////////////////////////////////////////////////
460 /////////////////////////////////////////////////////////////////////////////
462 /////////////////////////////////////////////////////////////////////////////
464 /////////////////////////////////////////////////////////////////////////////
465 // Instance variables
466 /////////////////////////////////////////////////////////////////////////////
468 /////////////////////////////////////////////////////////////////////////////
470 /////////////////////////////////////////////////////////////////////////////
472 /////////////////////////////////////////////////////////////////////////////
474 /////////////////////////////////////////////////////////////////////////////
476 /////////////////////////////////////////////////////////////////////////////
477 // [interface name] implementation
478 /////////////////////////////////////////////////////////////////////////////
480 /////////////////////////////////////////////////////////////////////////////
481 // [super class] override methods
482 /////////////////////////////////////////////////////////////////////////////
484 /////////////////////////////////////////////////////////////////////////////
485 // Package protected methods
486 /////////////////////////////////////////////////////////////////////////////
488 /////////////////////////////////////////////////////////////////////////////
490 /////////////////////////////////////////////////////////////////////////////
492 /////////////////////////////////////////////////////////////////////////////
494 /////////////////////////////////////////////////////////////////////////////
496 /////////////////////////////////////////////////////////////////////////////
498 /////////////////////////////////////////////////////////////////////////////