Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.portlet.util
Class HttpServletRequestMock

    java.lang.Object
      org.apache.struts2.portlet.util.HttpServletRequestMock

All Implemented Interfaces:
  HttpServletRequest, ServletRequest

    public class HttpServletRequestMock

extends Object
implements HttpServletRequest

A simple mock class to interact with Struts 2 API's that require a servlet request

Field Summary
`private Map` | `parameterMap`
`private String` | `servletPath`

Fields inherited from interface javax.servlet.http.HttpServletRequest
`BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH`

Constructor Summary
`HttpServletRequestMock()`

Method Summary
`Object` | `getAttribute(String arg0)`
`Enumeration` | `getAttributeNames()`
`String` | `getAuthType()`
`String` | `getCharacterEncoding()`
`int` | `getContentLength()`
`String` | `getContentType()`
`String` | `getContextPath()`
`Cookie[]` | `getCookies()`
`long` | `getDateHeader(String arg0)`
`String` | `getHeader(String arg0)`
`Enumeration` | `getHeaderNames()`
`Enumeration` | `getHeaders(String arg0)`
`ServletInputStream` | `getInputStream()`
`int` | `getIntHeader(String arg0)`
`String` | `getLocalAddr()`
`Locale` | `getLocale()`
`Enumeration` | `getLocales()`
`String` | `getLocalName()`
`int` | `getLocalPort()`
`String` | `getMethod()`
`String` | `getParameter(String arg0)`
`Map` | `getParameterMap()`
`Enumeration` | `getParameterNames()`
`String[]` | `getParameterValues(String arg0)`
`String` | `getPathInfo()`
`String` | `getPathTranslated()`
`String` | `getProtocol()`
`String` | `getQueryString()`
`BufferedReader` | `getReader()`
`String` | `getRealPath(String arg0)`
`String` | `getRemoteAddr()`
`String` | `getRemoteHost()`
`int` | `getRemotePort()`
`String` | `getRemoteUser()`
`RequestDispatcher` | `getRequestDispatcher(String arg0)`
`String` | `getRequestedSessionId()`
`String` | `getRequestURI()`
`StringBuffer` | `getRequestURL()`
`String` | `getScheme()`
`String` | `getServerName()`
`int` | `getServerPort()`
`String` | `getServletPath()`
`HttpSession` | `getSession()`
`HttpSession` | `getSession(boolean arg0)`
`Principal` | `getUserPrincipal()`
`boolean` | `isRequestedSessionIdFromCookie()`
`boolean` | `isRequestedSessionIdFromUrl()`
`boolean` | `isRequestedSessionIdFromURL()`
`boolean` | `isRequestedSessionIdValid()`
`boolean` | `isSecure()`
`boolean` | `isUserInRole(String arg0)`
`void` | `removeAttribute(String arg0)`
`void` | `setAttribute(String arg0, Object arg1)`
`void` | `setCharacterEncoding(String arg0)`
`HttpServletRequestMock` | `setParameterMap(Map parameterMap)`
`HttpServletRequestMock` | `setServletPath(String servletPath)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### servletPath

    private String servletPath

### parameterMap

    private Map parameterMap

Constructor Detail

### HttpServletRequestMock

    public HttpServletRequestMock()

Method Detail

### getAuthType

    public String getAuthType()

  Specified by:
    `getAuthType` in interface `HttpServletRequest`

### getContextPath

    public String getContextPath()

  Specified by:
    `getContextPath` in interface `HttpServletRequest`

### getCookies

    public Cookie[] getCookies()

  Specified by:
    `getCookies` in interface `HttpServletRequest`

### getDateHeader

    public long getDateHeader(String arg0)

  Specified by:
    `getDateHeader` in interface `HttpServletRequest`

### getHeader

    public String getHeader(String arg0)

  Specified by:
    `getHeader` in interface `HttpServletRequest`

### getHeaderNames

    public Enumeration getHeaderNames()

  Specified by:
    `getHeaderNames` in interface `HttpServletRequest`

### getHeaders

    public Enumeration getHeaders(String arg0)

  Specified by:
    `getHeaders` in interface `HttpServletRequest`

### getIntHeader

    public int getIntHeader(String arg0)

  Specified by:
    `getIntHeader` in interface `HttpServletRequest`

### getMethod

    public String getMethod()

  Specified by:
    `getMethod` in interface `HttpServletRequest`

### getPathInfo

    public String getPathInfo()

  Specified by:
    `getPathInfo` in interface `HttpServletRequest`

### getPathTranslated

    public String getPathTranslated()

  Specified by:
    `getPathTranslated` in interface `HttpServletRequest`

### getQueryString

    public String getQueryString()

  Specified by:
    `getQueryString` in interface `HttpServletRequest`

### getRemoteUser

    public String getRemoteUser()

  Specified by:
    `getRemoteUser` in interface `HttpServletRequest`

### getRequestURI

    public String getRequestURI()

  Specified by:
    `getRequestURI` in interface `HttpServletRequest`

### getRequestURL

    public StringBuffer getRequestURL()

  Specified by:
    `getRequestURL` in interface `HttpServletRequest`

### getRequestedSessionId

    public String getRequestedSessionId()

  Specified by:
    `getRequestedSessionId` in interface `HttpServletRequest`

### getServletPath

    public String getServletPath()

  Specified by:
    `getServletPath` in interface `HttpServletRequest`

### getSession

    public HttpSession getSession()

  Specified by:
    `getSession` in interface `HttpServletRequest`

### getSession

    public HttpSession getSession(boolean arg0)

  Specified by:
    `getSession` in interface `HttpServletRequest`

### getUserPrincipal

    public Principal getUserPrincipal()

  Specified by:
    `getUserPrincipal` in interface `HttpServletRequest`

### isRequestedSessionIdFromCookie

    public boolean isRequestedSessionIdFromCookie()

  Specified by:
    `isRequestedSessionIdFromCookie` in interface `HttpServletRequest`

### isRequestedSessionIdFromURL

    public boolean isRequestedSessionIdFromURL()

  Specified by:
    `isRequestedSessionIdFromURL` in interface `HttpServletRequest`

### isRequestedSessionIdFromUrl

    public boolean isRequestedSessionIdFromUrl()

  Specified by:
    `isRequestedSessionIdFromUrl` in interface `HttpServletRequest`

### isRequestedSessionIdValid

    public boolean isRequestedSessionIdValid()

  Specified by:
    `isRequestedSessionIdValid` in interface `HttpServletRequest`

### isUserInRole

    public boolean isUserInRole(String arg0)

  Specified by:
    `isUserInRole` in interface `HttpServletRequest`

### getAttribute

    public Object getAttribute(String arg0)

  Specified by:
    `getAttribute` in interface `ServletRequest`

### getAttributeNames

    public Enumeration getAttributeNames()

  Specified by:
    `getAttributeNames` in interface `ServletRequest`

### getCharacterEncoding

    public String getCharacterEncoding()

  Specified by:
    `getCharacterEncoding` in interface `ServletRequest`

### getContentLength

    public int getContentLength()

  Specified by:
    `getContentLength` in interface `ServletRequest`

### getContentType

    public String getContentType()

  Specified by:
    `getContentType` in interface `ServletRequest`

### getInputStream

    public ServletInputStream getInputStream()
                                      throws IOException

  Specified by:
    `getInputStream` in interface `ServletRequest`
  Throws:
    `IOException`

### getLocalAddr

    public String getLocalAddr()

  Specified by:
    `getLocalAddr` in interface `ServletRequest`

### getLocalName

    public String getLocalName()

  Specified by:
    `getLocalName` in interface `ServletRequest`

### getLocalPort

    public int getLocalPort()

  Specified by:
    `getLocalPort` in interface `ServletRequest`

### getLocale

    public Locale getLocale()

  Specified by:
    `getLocale` in interface `ServletRequest`

### getLocales

    public Enumeration getLocales()

  Specified by:
    `getLocales` in interface `ServletRequest`

### getParameter

    public String getParameter(String arg0)

  Specified by:
    `getParameter` in interface `ServletRequest`

### getParameterMap

    public Map getParameterMap()

  Specified by:
    `getParameterMap` in interface `ServletRequest`

### getParameterNames

    public Enumeration getParameterNames()

  Specified by:
    `getParameterNames` in interface `ServletRequest`

### getParameterValues

    public String[] getParameterValues(String arg0)

  Specified by:
    `getParameterValues` in interface `ServletRequest`

### getProtocol

    public String getProtocol()

  Specified by:
    `getProtocol` in interface `ServletRequest`

### getReader

    public BufferedReader getReader()
                             throws IOException

  Specified by:
    `getReader` in interface `ServletRequest`
  Throws:
    `IOException`

### getRealPath

    public String getRealPath(String arg0)

  Specified by:
    `getRealPath` in interface `ServletRequest`

### getRemoteAddr

    public String getRemoteAddr()

  Specified by:
    `getRemoteAddr` in interface `ServletRequest`

### getRemoteHost

    public String getRemoteHost()

  Specified by:
    `getRemoteHost` in interface `ServletRequest`

### getRemotePort

    public int getRemotePort()

  Specified by:
    `getRemotePort` in interface `ServletRequest`

### getRequestDispatcher

    public RequestDispatcher getRequestDispatcher(String arg0)

  Specified by:
    `getRequestDispatcher` in interface `ServletRequest`

### getScheme

    public String getScheme()

  Specified by:
    `getScheme` in interface `ServletRequest`

### getServerName

    public String getServerName()

  Specified by:
    `getServerName` in interface `ServletRequest`

### getServerPort

    public int getServerPort()

  Specified by:
    `getServerPort` in interface `ServletRequest`

### isSecure

    public boolean isSecure()

  Specified by:
    `isSecure` in interface `ServletRequest`

### removeAttribute

    public void removeAttribute(String arg0)

  Specified by:
    `removeAttribute` in interface `ServletRequest`

### setAttribute

    public void setAttribute(String arg0,
                             Object arg1)

  Specified by:
    `setAttribute` in interface `ServletRequest`

### setCharacterEncoding

    public void setCharacterEncoding(String arg0)
                              throws UnsupportedEncodingException

  Specified by:
    `setCharacterEncoding` in interface `ServletRequest`
  Throws:
    `UnsupportedEncodingException`

### setParameterMap

    public HttpServletRequestMock setParameterMap(Map parameterMap)

  Parameters:
    `parameterMap` - the parameterMap to set

### setServletPath

    public HttpServletRequestMock setServletPath(String servletPath)

  Parameters:
    `servletPath` - the servletPath to set

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.