Class JavaxMockHttpServletRequest

java.lang.Object
org.apache.commons.fileupload2.javax.JavaxMockHttpServletRequest
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class JavaxMockHttpServletRequest extends Object implements javax.servlet.http.HttpServletRequest
Test fixture for HttpServletRequest.
  • Constructor Details

    • JavaxMockHttpServletRequest

      public JavaxMockHttpServletRequest(byte[] requestData, String contentType)
      Creates a new instance with the given request data and content type.
    • JavaxMockHttpServletRequest

      public JavaxMockHttpServletRequest(InputStream requestInputStream, long requestLength, String contentType, int readLimit)
      Creates a new instance with the given request data and content type.
  • Method Details

    • getAttribute

      public Object getAttribute(String arg0)
      Specified by:
      getAttribute in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getAttribute(String)
    • getAttributeNames

      Specified by:
      getAttributeNames in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getAttributeNames()
    • getAuthType

      public String getAuthType()
      Specified by:
      getAuthType in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getAuthType()
    • getCharacterEncoding

      Specified by:
      getCharacterEncoding in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getCharacterEncoding()
    • getContentLength

      public int getContentLength()
      Specified by:
      getContentLength in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getContentLength()
    • getContentType

      Specified by:
      getContentType in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getContentType()
    • getContextPath

      Specified by:
      getContextPath in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getContextPath()
    • getCookies

      public javax.servlet.http.Cookie[] getCookies()
      Specified by:
      getCookies in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getCookies()
    • getDateHeader

      public long getDateHeader(String arg0)
      Specified by:
      getDateHeader in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getDateHeader(String)
    • getHeader

      public String getHeader(String headerName)
      Specified by:
      getHeader in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getHeader(String)
    • getHeaderNames

      Specified by:
      getHeaderNames in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getHeaderNames()
    • getHeaders

      Specified by:
      getHeaders in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getHeaders(String)
    • getInputStream

      public javax.servlet.ServletInputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface javax.servlet.ServletRequest
      Throws:
      IOException
      See Also:
      • ServletRequest.getInputStream()
    • getIntHeader

      public int getIntHeader(String arg0)
      Specified by:
      getIntHeader in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getIntHeader(String)
    • getLocalAddr

      public String getLocalAddr()
      Specified by:
      getLocalAddr in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getLocalAddr()
    • getLocale

      public Locale getLocale()
      Specified by:
      getLocale in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getLocale()
    • getLocales

      Specified by:
      getLocales in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getLocales()
    • getLocalName

      public String getLocalName()
      Specified by:
      getLocalName in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getLocalName()
    • getLocalPort

      public int getLocalPort()
      Specified by:
      getLocalPort in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getLocalPort()
    • getMethod

      public String getMethod()
      Specified by:
      getMethod in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getMethod()
    • getParameter

      public String getParameter(String arg0)
      Specified by:
      getParameter in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getParameter(String)
    • getParameterMap

      Specified by:
      getParameterMap in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getParameterMap()
    • getParameterNames

      Specified by:
      getParameterNames in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getParameterNames()
    • getParameterValues

      public String[] getParameterValues(String arg0)
      Specified by:
      getParameterValues in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getParameterValues(String)
    • getPathInfo

      public String getPathInfo()
      Specified by:
      getPathInfo in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getPathInfo()
    • getPathTranslated

      Specified by:
      getPathTranslated in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getPathTranslated()
    • getProtocol

      public String getProtocol()
      Specified by:
      getProtocol in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getProtocol()
    • getQueryString

      Specified by:
      getQueryString in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getQueryString()
    • getReader

      Specified by:
      getReader in interface javax.servlet.ServletRequest
      Throws:
      IOException
      See Also:
      • ServletRequest.getReader()
    • getRealPath

      Deprecated.
      Specified by:
      getRealPath in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getRealPath(String)
    • getRemoteAddr

      Specified by:
      getRemoteAddr in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getRemoteAddr()
    • getRemoteHost

      Specified by:
      getRemoteHost in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getRemoteHost()
    • getRemotePort

      public int getRemotePort()
      Specified by:
      getRemotePort in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getRemotePort()
    • getRemoteUser

      Specified by:
      getRemoteUser in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getRemoteUser()
    • getRequestDispatcher

      public javax.servlet.RequestDispatcher getRequestDispatcher(String arg0)
      Specified by:
      getRequestDispatcher in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getRequestDispatcher(String)
    • getRequestedSessionId

      Specified by:
      getRequestedSessionId in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getRequestedSessionId()
    • getRequestURI

      Specified by:
      getRequestURI in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getRequestURI()
    • getRequestURL

      Specified by:
      getRequestURL in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getRequestURL()
    • getScheme

      public String getScheme()
      Specified by:
      getScheme in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getScheme()
    • getServerName

      Specified by:
      getServerName in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getServerName()
    • getServerPort

      public int getServerPort()
      Specified by:
      getServerPort in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.getServerPort()
    • getServletPath

      Specified by:
      getServletPath in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getServletPath()
    • getSession

      public javax.servlet.http.HttpSession getSession()
      Specified by:
      getSession in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getSession()
    • getSession

      public javax.servlet.http.HttpSession getSession(boolean arg0)
      Specified by:
      getSession in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getSession(boolean)
    • getUserPrincipal

      Specified by:
      getUserPrincipal in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.getUserPrincipal()
    • isRequestedSessionIdFromCookie

      Specified by:
      isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.isRequestedSessionIdFromCookie()
    • isRequestedSessionIdFromUrl

      Deprecated.
      Specified by:
      isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.isRequestedSessionIdFromUrl()
    • isRequestedSessionIdFromURL

      public boolean isRequestedSessionIdFromURL()
      Specified by:
      isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.isRequestedSessionIdFromURL()
    • isRequestedSessionIdValid

      public boolean isRequestedSessionIdValid()
      Specified by:
      isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.isRequestedSessionIdValid()
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.isSecure()
    • isUserInRole

      public boolean isUserInRole(String arg0)
      Specified by:
      isUserInRole in interface javax.servlet.http.HttpServletRequest
      See Also:
      • HttpServletRequest.isUserInRole(String)
    • removeAttribute

      public void removeAttribute(String arg0)
      Specified by:
      removeAttribute in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.removeAttribute(String)
    • setAttribute

      public void setAttribute(String arg0, Object arg1)
      Specified by:
      setAttribute in interface javax.servlet.ServletRequest
      See Also:
      • ServletRequest.setAttribute(String, Object)
    • setCharacterEncoding

      Specified by:
      setCharacterEncoding in interface javax.servlet.ServletRequest
      Throws:
      UnsupportedEncodingException
      See Also:
      • ServletRequest.setCharacterEncoding(String)