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.servicedecomposition.test;
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 throw new UnsupportedOperationException("getAttribute");
72 public Enumeration<String> getAttributeNames() {
73 throw new UnsupportedOperationException("getAttributeNames");
77 public String getCharacterEncoding() {
78 throw new UnsupportedOperationException("getCharacterEncoding");
82 public void setCharacterEncoding(String env) throws UnsupportedEncodingException {
83 throw new UnsupportedOperationException("setCharacterEncoding");
87 public int getContentLength() {
88 throw new UnsupportedOperationException("getContentLength");
92 public long getContentLengthLong() {
93 throw new UnsupportedOperationException("getContentLengthLong");
97 public String getContentType() {
98 throw new UnsupportedOperationException("getContentType");
102 public ServletInputStream getInputStream() throws IOException {
103 throw new UnsupportedOperationException("getInputStream");
107 public String getParameter(String name) {
108 throw new UnsupportedOperationException("getParameter");
112 public Enumeration<String> getParameterNames() {
113 throw new UnsupportedOperationException("getParameterNames");
117 public String[] getParameterValues(String name) {
118 throw new UnsupportedOperationException("getParameterValues");
122 public Map<String, String[]> getParameterMap() {
123 throw new UnsupportedOperationException("getParameterMap");
127 public String getProtocol() {
128 throw new UnsupportedOperationException("getProtocol");
132 public String getScheme() {
133 throw new UnsupportedOperationException("getScheme");
137 public int getServerPort() {
138 throw new UnsupportedOperationException("getServerPort");
142 public BufferedReader getReader() throws IOException {
143 throw new UnsupportedOperationException("getReader");
147 public String getRemoteHost() {
148 throw new UnsupportedOperationException("getRemoteHost");
152 public void setAttribute(String name, Object obj) {
153 throw new UnsupportedOperationException("setAttribute");
157 public void removeAttribute(String name) {
158 throw new UnsupportedOperationException("removeAttribute");
162 public Locale getLocale() {
163 throw new UnsupportedOperationException("getLocale");
167 public Enumeration<Locale> getLocales() {
168 throw new UnsupportedOperationException("getLocales");
172 public boolean isSecure() {
173 throw new UnsupportedOperationException("isSecure");
177 public RequestDispatcher getRequestDispatcher(String path) {
178 throw new UnsupportedOperationException("getRequestDispatcher");
182 public String getRealPath(String path) {
183 throw new UnsupportedOperationException("getRealPath");
187 public int getRemotePort() {
188 throw new UnsupportedOperationException("getRemotePort");
192 public String getLocalName() {
193 throw new UnsupportedOperationException("getLocalName");
197 public String getLocalAddr() {
198 throw new UnsupportedOperationException("getLocalAddr");
202 public int getLocalPort() {
203 throw new UnsupportedOperationException("getLocalPort");
207 public ServletContext getServletContext() {
208 throw new UnsupportedOperationException("getServletContext");
212 public AsyncContext startAsync() throws IllegalStateException {
213 throw new UnsupportedOperationException("startAsync");
217 public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
218 throws IllegalStateException {
219 throw new UnsupportedOperationException("startAsync");
223 public boolean isAsyncStarted() {
224 throw new UnsupportedOperationException("isAsyncStarted");
228 public boolean isAsyncSupported() {
229 throw new UnsupportedOperationException("isAsyncSupported");
233 public AsyncContext getAsyncContext() {
234 throw new UnsupportedOperationException("getAsyncContext");
238 public DispatcherType getDispatcherType() {
239 throw new UnsupportedOperationException("getDispatcherType");
243 public String getAuthType() {
244 throw new UnsupportedOperationException("getAuthType");
248 public Cookie[] getCookies() {
249 throw new UnsupportedOperationException("getCookies");
253 public long getDateHeader(String name) {
254 throw new UnsupportedOperationException("getDateHeader");
258 public Enumeration<String> getHeaders(String name) {
259 throw new UnsupportedOperationException("getHeaders");
263 public Enumeration<String> getHeaderNames() {
264 throw new UnsupportedOperationException("getHeaderNames");
268 public int getIntHeader(String name) {
269 throw new UnsupportedOperationException("getIntHeader");
273 public String getMethod() {
274 throw new UnsupportedOperationException("getMethod");
278 public String getPathInfo() {
279 throw new UnsupportedOperationException("getPathInfo");
283 public String getPathTranslated() {
284 throw new UnsupportedOperationException("getPathTranslated");
288 public String getContextPath() {
289 throw new UnsupportedOperationException("getContextPath");
293 public String getQueryString() {
294 throw new UnsupportedOperationException("getQueryString");
298 public String getRemoteUser() {
299 throw new UnsupportedOperationException("getRemoteUser");
303 public boolean isUserInRole(String role) {
304 throw new UnsupportedOperationException("isUserInRole");
308 public Principal getUserPrincipal() {
309 throw new UnsupportedOperationException("getUserPrincipal");
313 public String getRequestedSessionId() {
314 throw new UnsupportedOperationException("getRequestedSessionId");
318 public StringBuffer getRequestURL() {
319 throw new UnsupportedOperationException("getRequestURL");
323 public String getServletPath() {
324 throw new UnsupportedOperationException("getServletPath");
328 public HttpSession getSession(boolean create) {
329 throw new UnsupportedOperationException("getSession");
333 public HttpSession getSession() {
334 throw new UnsupportedOperationException("getSession");
338 public String changeSessionId() {
339 throw new UnsupportedOperationException("changeSessionId");
343 public boolean isRequestedSessionIdValid() {
344 throw new UnsupportedOperationException("isRequestedSessionIdValid");
348 public boolean isRequestedSessionIdFromCookie() {
349 throw new UnsupportedOperationException("isRequestedSessionIdFromCookie");
353 public boolean isRequestedSessionIdFromURL() {
354 throw new UnsupportedOperationException("isRequestedSessionIdFromURL");
358 public boolean isRequestedSessionIdFromUrl() {
359 throw new UnsupportedOperationException("isRequestedSessionIdFromUrl");
363 public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
364 throw new UnsupportedOperationException("authenticate");
368 public void login(String username, String password) throws ServletException {
369 throw new UnsupportedOperationException("login");
373 public void logout() throws ServletException {
374 throw new UnsupportedOperationException("logout");
378 public Collection<Part> getParts() throws IOException, ServletException {
379 throw new UnsupportedOperationException("getParts");
383 public Part getPart(String name) throws IOException, ServletException {
384 throw new UnsupportedOperationException("getPart");
388 public <T extends HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass)
389 throws IOException, ServletException {
390 throw new UnsupportedOperationException("upgrade");