|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mockrunner.mock.web.MockFilterChain
public class MockFilterChain
Mock implementation of FilterChain
.
Constructor Summary | |
---|---|
MockFilterChain()
|
Method Summary | |
---|---|
void |
addFilter(java.lang.Class filterClass)
Adds a filter to the chain. |
void |
addFilter(javax.servlet.Filter filter)
Adds a filter to the chain. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
|
javax.servlet.ServletRequest |
getLastRequest()
Returns the last request, usually the request that was used to call the final servlet. |
javax.servlet.ServletResponse |
getLastResponse()
Returns the last response, usually the response that was used to call the final servlet. |
java.util.List |
getRequestList()
Returns the list of all request objects used to call doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) when iterating through the chain. |
java.util.List |
getResponseList()
Returns the list of all response objects used to call doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) when iterating through the chain. |
void |
release()
Clears all filters and sets the current servlet to null . |
void |
reset()
Resets the internal iterator of this chain. |
void |
setServlet(javax.servlet.Servlet servlet)
Sets the servlet that is called at the end of the chain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockFilterChain()
Method Detail |
---|
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.FilterChain
java.io.IOException
javax.servlet.ServletException
public void reset()
public void addFilter(javax.servlet.Filter filter)
filter
- the filterpublic void addFilter(java.lang.Class filterClass)
javax.servlet.Filter
.
filterClass
- the filter class
java.lang.IllegalArgumentException
- if the specified class does not implement
javax.servlet.Filter
public void setServlet(javax.servlet.Servlet servlet)
servlet
- the servletpublic void release()
null
.
public java.util.List getRequestList()
doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
when iterating through the chain.
public java.util.List getResponseList()
doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
when iterating through the chain.
public javax.servlet.ServletRequest getLastRequest()
null
if no request is specified, e.g. if the chain wasn't called.
Otherwise returns the last entry of the list returned by
getRequestList()
.
public javax.servlet.ServletResponse getLastResponse()
null
if no response is specified, e.g. if the chain wasn't called.
Otherwise returns the last entry of the list returned by
getResponseList()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |