|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.jsfunit.context.JSFUnitHttpServletRequest
public class JSFUnitHttpServletRequest
This class takes the same approach as the JSFUnitExternalContext in that it caches everything possible from the HttpServletRequest so that it will be available to the JSFUnit test. For a few methods, it is impossible or impractical to provide an implementation because the request is finished and the servlet container is free to recycle the original HttpServletRequest. So a few methods throw UnsupportedOperationException. A few methods also warn that using them can lead to unexpected results. Those methods that are unreliable have a warning in the javadoc.
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
JSFUnitHttpServletRequest(JSFUnitExternalContext extCtx,
javax.servlet.http.HttpServletRequest request)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSFUnitHttpServletRequest(JSFUnitExternalContext extCtx, javax.servlet.http.HttpServletRequest request)
Method Detail |
---|
public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public Enumeration getLocales()
getLocales
in interface javax.servlet.ServletRequest
public Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
public Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.ServletInputStream getInputStream() throws IOException
getInputStream
in interface javax.servlet.ServletRequest
UnsupportedOperationException
IOException
public BufferedReader getReader() throws IOException
getReader
in interface javax.servlet.ServletRequest
UnsupportedOperationException
IOException
public String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
public String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
public String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public String getScheme()
getScheme
in interface javax.servlet.ServletRequest
public String getServerName()
getServerName
in interface javax.servlet.ServletRequest
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
public String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
public void setAttribute(String attribute, Object value)
setAttribute
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(String string) throws UnsupportedEncodingException
setCharacterEncoding
in interface javax.servlet.ServletRequest
UnsupportedEncodingException
public String[] getParameterValues(String name)
getParameterValues
in interface javax.servlet.ServletRequest
public String getParameter(String name)
getParameter
in interface javax.servlet.ServletRequest
public int getIntHeader(String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
public Object getAttribute(String name)
getAttribute
in interface javax.servlet.ServletRequest
public long getDateHeader(String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
public String getHeader(String name)
getHeader
in interface javax.servlet.http.HttpServletRequest
public Enumeration getHeaders(String name)
getHeaders
in interface javax.servlet.http.HttpServletRequest
public String getRealPath(String string)
getRealPath
in interface javax.servlet.ServletRequest
UnsupportedOperationException
public javax.servlet.RequestDispatcher getRequestDispatcher(String string)
getRequestDispatcher
in interface javax.servlet.ServletRequest
UnsupportedOperationException
public boolean isUserInRole(String name)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public void removeAttribute(String name)
removeAttribute
in interface javax.servlet.ServletRequest
public int getLocalPort()
UnsupportedOperationException
- if running in a container that
does not support servlet 2.4 or greater.public int getRemotePort()
UnsupportedOperationException
- if running in a container that
does not support servlet 2.4 or greater.public String getLocalName()
UnsupportedOperationException
- if running in a container that
does not support servlet 2.4 or greater.public String getLocalAddr()
UnsupportedOperationException
- if running in a container that
does not support servlet 2.4 or greater.public javax.servlet.http.Part getPart(String part)
UnsupportedOperationException
public Collection<javax.servlet.http.Part> getParts()
UnsupportedOperationException
public void logout() throws javax.servlet.ServletException
UnsupportedOperationException
javax.servlet.ServletException
public void login(String username, String password) throws javax.servlet.ServletException
UnsupportedOperationException
javax.servlet.ServletException
public boolean authenticate(javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
UnsupportedOperationException
IOException
javax.servlet.ServletException
public javax.servlet.DispatcherType getDispatcherType()
public javax.servlet.AsyncContext getAsyncContext()
public boolean isAsyncStarted()
public boolean isAsyncSupported()
public javax.servlet.AsyncContext startAsync()
public javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws IllegalStateException
IllegalStateException
public javax.servlet.ServletContext getServletContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |