1 package org.apache.maven.repository.proxy.web.action.test.stub;
4 * Copyright 2005-2006 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 import javax.servlet.RequestDispatcher;
20 import javax.servlet.ServletInputStream;
21 import javax.servlet.ServletRequest;
22 import java.io.BufferedReader;
23 import java.util.Enumeration;
24 import java.util.HashMap;
25 import java.util.Locale;
28 public class ServletRequestStub
29 implements ServletRequest
32 public Object getAttribute( String key )
37 public Enumeration getAttributeNames()
42 public String getCharacterEncoding()
47 public int getContentLength()
52 public int getRemotePort()
57 public int getLocalPort()
62 public String getLocalAddr()
67 public String getLocalName()
72 public String getContentType()
77 public ServletInputStream getInputStream()
82 public Locale getLocale()
87 public Enumeration getLocales()
92 public String getParameter( String name )
97 public Map getParameterMap()
99 HashMap parameterMap = new HashMap();
101 parameterMap.put( "key1", "value1" );
102 parameterMap.put( "key2", "value2" );
107 public Enumeration getParameterNames()
112 public String[] getParameterValues( String name )
117 public String getProtocol()
122 public BufferedReader getReader()
127 public String getRealPath( String path )
132 public String getRemoteAddr()
137 public String getRemoteHost()
142 public RequestDispatcher getRequestDispatcher( String path )
147 public String getScheme()
152 public String getServerName()
157 public int getServerPort()
162 public boolean isSecure()
167 public void removeAttribute( String name )
172 public void setAttribute( String name, Object value )
177 public void setCharacterEncoding( String env )