|
||||||||||
| 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.HttpServletRequestpublic String getProtocol()
getProtocol in interface javax.servlet.ServletRequestpublic String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic Map getParameterMap()
getParameterMap in interface javax.servlet.ServletRequestpublic String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic Enumeration getLocales()
getLocales in interface javax.servlet.ServletRequestpublic Locale getLocale()
getLocale in interface javax.servlet.ServletRequestpublic Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.ServletRequestpublic String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestpublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestpublic String getContentType()
getContentType in interface javax.servlet.ServletRequestpublic String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic Enumeration getHeaderNames()
getHeaderNames in interface javax.servlet.http.HttpServletRequest
public javax.servlet.ServletInputStream getInputStream()
throws IOException
getInputStream in interface javax.servlet.ServletRequestUnsupportedOperationException
IOException
public BufferedReader getReader()
throws IOException
getReader in interface javax.servlet.ServletRequestUnsupportedOperationException
IOExceptionpublic String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestpublic String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequestpublic String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic StringBuffer getRequestURL()
getRequestURL in interface javax.servlet.http.HttpServletRequestpublic String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic String getScheme()
getScheme in interface javax.servlet.ServletRequestpublic String getServerName()
getServerName in interface javax.servlet.ServletRequestpublic int getServerPort()
getServerPort in interface javax.servlet.ServletRequestpublic String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestpublic Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic boolean isSecure()
isSecure in interface javax.servlet.ServletRequestpublic 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.ServletRequestUnsupportedEncodingExceptionpublic String[] getParameterValues(String name)
getParameterValues in interface javax.servlet.ServletRequestpublic String getParameter(String name)
getParameter in interface javax.servlet.ServletRequestpublic int getIntHeader(String name)
getIntHeader in interface javax.servlet.http.HttpServletRequestpublic Object getAttribute(String name)
getAttribute in interface javax.servlet.ServletRequestpublic long getDateHeader(String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestpublic String getHeader(String name)
getHeader in interface javax.servlet.http.HttpServletRequestpublic Enumeration getHeaders(String name)
getHeaders in interface javax.servlet.http.HttpServletRequestpublic String getRealPath(String string)
getRealPath in interface javax.servlet.ServletRequestUnsupportedOperationExceptionpublic javax.servlet.RequestDispatcher getRequestDispatcher(String string)
getRequestDispatcher in interface javax.servlet.ServletRequestUnsupportedOperationExceptionpublic boolean isUserInRole(String name)
isUserInRole in interface javax.servlet.http.HttpServletRequestpublic void removeAttribute(String name)
removeAttribute in interface javax.servlet.ServletRequestpublic 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)
UnsupportedOperationExceptionpublic 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.ServletExceptionpublic 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
IllegalStateExceptionpublic javax.servlet.ServletContext getServletContext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||