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=====================================================
19 package org.onap.sdnc.apps.pomba.networkdiscovery.unittest.service;
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;
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;
44 public class TestHttpServletRequest implements HttpServletRequest {
46 public String getHeader(String name) {
51 public String getRemoteAddr() {
56 public String getServerName() {
61 public String getRequestURI() {
67 public Object getAttribute(String name) {
68 // TODO Implement getAttribute
69 throw new UnsupportedOperationException("getAttribute");
73 public Enumeration<String> getAttributeNames() {
74 // TODO Implement getAttributeNames
75 throw new UnsupportedOperationException("getAttributeNames");
79 public String getCharacterEncoding() {
80 // TODO Implement getCharacterEncoding
81 throw new UnsupportedOperationException("getCharacterEncoding");
85 public void setCharacterEncoding(String env) throws UnsupportedEncodingException {
86 // TODO Implement setCharacterEncoding
87 throw new UnsupportedOperationException("setCharacterEncoding");
91 public int getContentLength() {
92 // TODO Implement getContentLength
93 throw new UnsupportedOperationException("getContentLength");
97 public long getContentLengthLong() {
98 // TODO Implement getContentLengthLong
99 throw new UnsupportedOperationException("getContentLengthLong");
103 public String getContentType() {
104 // TODO Implement getContentType
105 throw new UnsupportedOperationException("getContentType");
109 public ServletInputStream getInputStream() throws IOException {
110 // TODO Implement getInputStream
111 throw new UnsupportedOperationException("getInputStream");
115 public String getParameter(String name) {
116 // TODO Implement getParameter
117 throw new UnsupportedOperationException("getParameter");
121 public Enumeration<String> getParameterNames() {
122 // TODO Implement getParameterNames
123 throw new UnsupportedOperationException("getParameterNames");
127 public String[] getParameterValues(String name) {
128 // TODO Implement getParameterValues
129 throw new UnsupportedOperationException("getParameterValues");
133 public Map<String, String[]> getParameterMap() {
134 // TODO Implement getParameterMap
135 throw new UnsupportedOperationException("getParameterMap");
139 public String getProtocol() {
140 // TODO Implement getProtocol
141 throw new UnsupportedOperationException("getProtocol");
145 public String getScheme() {
146 // TODO Implement getScheme
147 throw new UnsupportedOperationException("getScheme");
151 public int getServerPort() {
152 // TODO Implement getServerPort
153 throw new UnsupportedOperationException("getServerPort");
157 public BufferedReader getReader() throws IOException {
158 // TODO Implement getReader
159 throw new UnsupportedOperationException("getReader");
163 public String getRemoteHost() {
164 // TODO Implement getRemoteHost
165 throw new UnsupportedOperationException("getRemoteHost");
169 public void setAttribute(String name, Object obj) {
170 // TODO Implement setAttribute
171 throw new UnsupportedOperationException("setAttribute");
175 public void removeAttribute(String name) {
176 // TODO Implement removeAttribute
177 throw new UnsupportedOperationException("removeAttribute");
181 public Locale getLocale() {
182 // TODO Implement getLocale
183 throw new UnsupportedOperationException("getLocale");
187 public Enumeration<Locale> getLocales() {
188 // TODO Implement getLocales
189 throw new UnsupportedOperationException("getLocales");
193 public boolean isSecure() {
194 // TODO Implement isSecure
195 throw new UnsupportedOperationException("isSecure");
199 public RequestDispatcher getRequestDispatcher(String path) {
200 // TODO Implement getRequestDispatcher
201 throw new UnsupportedOperationException("getRequestDispatcher");
205 public String getRealPath(String path) {
206 // TODO Implement getRealPath
207 throw new UnsupportedOperationException("getRealPath");
211 public int getRemotePort() {
212 // TODO Implement getRemotePort
213 throw new UnsupportedOperationException("getRemotePort");
217 public String getLocalName() {
218 // TODO Implement getLocalName
219 throw new UnsupportedOperationException("getLocalName");
223 public String getLocalAddr() {
224 // TODO Implement getLocalAddr
225 throw new UnsupportedOperationException("getLocalAddr");
229 public int getLocalPort() {
230 // TODO Implement getLocalPort
231 throw new UnsupportedOperationException("getLocalPort");
235 public ServletContext getServletContext() {
236 // TODO Implement getServletContext
237 throw new UnsupportedOperationException("getServletContext");
241 public AsyncContext startAsync() throws IllegalStateException {
242 // TODO Implement startAsync
243 throw new UnsupportedOperationException("startAsync");
247 public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
248 throws IllegalStateException {
249 // TODO Implement startAsync
250 throw new UnsupportedOperationException("startAsync");
254 public boolean isAsyncStarted() {
255 // TODO Implement isAsyncStarted
256 throw new UnsupportedOperationException("isAsyncStarted");
260 public boolean isAsyncSupported() {
261 // TODO Implement isAsyncSupported
262 throw new UnsupportedOperationException("isAsyncSupported");
266 public AsyncContext getAsyncContext() {
267 // TODO Implement getAsyncContext
268 throw new UnsupportedOperationException("getAsyncContext");
272 public DispatcherType getDispatcherType() {
273 // TODO Implement getDispatcherType
274 throw new UnsupportedOperationException("getDispatcherType");
278 public String getAuthType() {
279 // TODO Implement getAuthType
280 throw new UnsupportedOperationException("getAuthType");
284 public Cookie[] getCookies() {
285 // TODO Implement getCookies
286 throw new UnsupportedOperationException("getCookies");
290 public long getDateHeader(String name) {
291 // TODO Implement getDateHeader
292 throw new UnsupportedOperationException("getDateHeader");
296 public Enumeration<String> getHeaders(String name) {
297 // TODO Implement getHeaders
298 throw new UnsupportedOperationException("getHeaders");
302 public Enumeration<String> getHeaderNames() {
303 // TODO Implement getHeaderNames
304 throw new UnsupportedOperationException("getHeaderNames");
308 public int getIntHeader(String name) {
309 // TODO Implement getIntHeader
310 throw new UnsupportedOperationException("getIntHeader");
314 public String getMethod() {
315 // TODO Implement getMethod
316 throw new UnsupportedOperationException("getMethod");
320 public String getPathInfo() {
321 // TODO Implement getPathInfo
322 throw new UnsupportedOperationException("getPathInfo");
326 public String getPathTranslated() {
327 // TODO Implement getPathTranslated
328 throw new UnsupportedOperationException("getPathTranslated");
332 public String getContextPath() {
333 // TODO Implement getContextPath
334 throw new UnsupportedOperationException("getContextPath");
338 public String getQueryString() {
339 // TODO Implement getQueryString
340 throw new UnsupportedOperationException("getQueryString");
344 public String getRemoteUser() {
345 // TODO Implement getRemoteUser
346 throw new UnsupportedOperationException("getRemoteUser");
350 public boolean isUserInRole(String role) {
351 // TODO Implement isUserInRole
352 throw new UnsupportedOperationException("isUserInRole");
356 public Principal getUserPrincipal() {
357 // TODO Implement getUserPrincipal
358 throw new UnsupportedOperationException("getUserPrincipal");
362 public String getRequestedSessionId() {
363 // TODO Implement getRequestedSessionId
364 throw new UnsupportedOperationException("getRequestedSessionId");
368 public StringBuffer getRequestURL() {
369 // TODO Implement getRequestURL
370 throw new UnsupportedOperationException("getRequestURL");
374 public String getServletPath() {
375 // TODO Implement getServletPath
376 throw new UnsupportedOperationException("getServletPath");
380 public HttpSession getSession(boolean create) {
381 // TODO Implement getSession
382 throw new UnsupportedOperationException("getSession");
386 public HttpSession getSession() {
387 // TODO Implement getSession
388 throw new UnsupportedOperationException("getSession");
392 public String changeSessionId() {
393 // TODO Implement changeSessionId
394 throw new UnsupportedOperationException("changeSessionId");
398 public boolean isRequestedSessionIdValid() {
399 // TODO Implement isRequestedSessionIdValid
400 throw new UnsupportedOperationException("isRequestedSessionIdValid");
404 public boolean isRequestedSessionIdFromCookie() {
405 // TODO Implement isRequestedSessionIdFromCookie
406 throw new UnsupportedOperationException("isRequestedSessionIdFromCookie");
410 public boolean isRequestedSessionIdFromURL() {
411 // TODO Implement isRequestedSessionIdFromURL
412 throw new UnsupportedOperationException("isRequestedSessionIdFromURL");
416 public boolean isRequestedSessionIdFromUrl() {
417 // TODO Implement isRequestedSessionIdFromUrl
418 throw new UnsupportedOperationException("isRequestedSessionIdFromUrl");
422 public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
423 // TODO Implement authenticate
424 throw new UnsupportedOperationException("authenticate");
428 public void login(String username, String password) throws ServletException {
429 // TODO Implement login
430 throw new UnsupportedOperationException("login");
434 public void logout() throws ServletException {
435 // TODO Implement logout
436 throw new UnsupportedOperationException("logout");
440 public Collection<Part> getParts() throws IOException, ServletException {
441 // TODO Implement getParts
442 throw new UnsupportedOperationException("getParts");
446 public Part getPart(String name) throws IOException, ServletException {
447 // TODO Implement getPart
448 throw new UnsupportedOperationException("getPart");
452 public <T extends HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass)
453 throws IOException, ServletException {
454 // TODO Implement upgrade
455 throw new UnsupportedOperationException("upgrade");
457 /////////////////////////////////////////////////////////////////////////////
459 /////////////////////////////////////////////////////////////////////////////
461 /////////////////////////////////////////////////////////////////////////////
463 /////////////////////////////////////////////////////////////////////////////
465 /////////////////////////////////////////////////////////////////////////////
466 // Instance variables
467 /////////////////////////////////////////////////////////////////////////////
469 /////////////////////////////////////////////////////////////////////////////
471 /////////////////////////////////////////////////////////////////////////////
473 /////////////////////////////////////////////////////////////////////////////
475 /////////////////////////////////////////////////////////////////////////////
477 /////////////////////////////////////////////////////////////////////////////
478 // [interface name] implementation
479 /////////////////////////////////////////////////////////////////////////////
481 /////////////////////////////////////////////////////////////////////////////
482 // [super class] override methods
483 /////////////////////////////////////////////////////////////////////////////
485 /////////////////////////////////////////////////////////////////////////////
486 // Package protected methods
487 /////////////////////////////////////////////////////////////////////////////
489 /////////////////////////////////////////////////////////////////////////////
491 /////////////////////////////////////////////////////////////////////////////
493 /////////////////////////////////////////////////////////////////////////////
495 /////////////////////////////////////////////////////////////////////////////
497 /////////////////////////////////////////////////////////////////////////////
499 /////////////////////////////////////////////////////////////////////////////