public abstract class BasicServletTestCaseAdapter extends BasicHTMLOutputTestCase
ServletTestModule. You can
subclass this adapter or use ServletTestModule
directly (so your test case can use another base class).
This basic adapter can be used if you don't need any other modules. It
does not extend BaseTestCase. If you want
to use several modules in conjunction, consider subclassing
com.mockrunner.servlet.ServletTestCaseAdapter.
This class is generated from the ServletTestModule
and should not be edited directly.| Constructor and Description |
|---|
BasicServletTestCaseAdapter() |
BasicServletTestCaseAdapter(String name) |
getOutput, getOutputAsBufferedReader, getOutputAsJDOMDocument, getOutputAsW3CDocument, getOutputAsWellformedXML, getWebTestModule, setCaseSensitive, verifyOutput, verifyOutputContains, verifyOutputRegularExpressionaddRequestParameter, addRequestParameter, addRequestParameter, getRequestAttribute, getRequestParameter, getSessionAttribute, setRequestAttribute, setSessionAttributepublic BasicServletTestCaseAdapter()
public BasicServletTestCaseAdapter(String name)
public void setUp()
throws Exception
ServletTestModule. If you
overwrite this method, you must call super.setUp().Exceptionprotected WebMockObjectFactory createWebMockObjectFactory()
WebMockObjectFactory.WebMockObjectFactoryprotected WebMockObjectFactory createWebMockObjectFactory(WebMockObjectFactory otherFactory)
createWebMockObjectFactory(otherFactory, true).protected WebMockObjectFactory createWebMockObjectFactory(WebMockObjectFactory otherFactory, boolean createNewSession)
WebMockObjectFactory based on another
WebMockObjectFactory.
The created WebMockObjectFactory will have its own
request and response objects. If you set createNewSession
to true it will also have its own session object.
The two factories will share one ServletContext.
Especially important for multithreading tests.
If you set createNewSession to false, the two factories
will share one session. This setting simulates multiple requests
from the same client.otherFactory - the other factorycreateNewSession - create a new session for the new factoryWebMockObjectFactoryprotected WebMockObjectFactory getWebMockObjectFactory()
WebMockObjectFactory.WebMockObjectFactoryprotected void setWebMockObjectFactory(WebMockObjectFactory webMockObjectFactory)
WebMockObjectFactory.webMockObjectFactory - the WebMockObjectFactoryprotected ServletTestModule createServletTestModule()
ServletTestModule based on the current
WebMockObjectFactory.
Same as createServletTestModule(getWebMockObjectFactory()).ServletTestModuleprotected ServletTestModule createServletTestModule(WebMockObjectFactory mockFactory)
ServletTestModule with the specified
WebMockObjectFactory.ServletTestModuleprotected HTMLOutputModule getHTMLOutputModule()
ServletTestModule as
HTMLOutputModule.getHTMLOutputModule in class BasicHTMLOutputTestCaseHTMLOutputModuleprotected ServletTestModule getServletTestModule()
ServletTestModule.ServletTestModuleprotected void setServletTestModule(ServletTestModule servletTestModule)
ServletTestModule.servletTestModule - the ServletTestModuleprotected void setServlet(javax.servlet.http.HttpServlet servlet)
ServletTestModule.setServlet(HttpServlet)protected void setServlet(javax.servlet.http.HttpServlet servlet,
boolean doInit)
ServletTestModule.setServlet(HttpServlet, boolean)protected void doGet()
ServletTestModule.doGet()protected void doPost()
ServletTestModule.doPost()protected void doHead()
ServletTestModule.doHead()protected void doPut()
ServletTestModule.doPut()protected void doDelete()
ServletTestModule.doDelete()protected void doOptions()
ServletTestModule.doOptions()protected void doTrace()
ServletTestModule.doTrace()protected javax.servlet.http.HttpServlet getServlet()
ServletTestModule.getServlet()protected javax.servlet.http.HttpServlet createServlet(Class servletClass)
ServletTestModule.createServlet(Class)protected javax.servlet.Filter createFilter(Class filterClass)
ServletTestModule.createFilter(Class)protected void addFilter(javax.servlet.Filter filter)
ServletTestModule.addFilter(Filter)protected void addFilter(javax.servlet.Filter filter,
boolean doInit)
ServletTestModule.addFilter(Filter, boolean)protected void releaseFilters()
ServletTestModule.releaseFilters()protected void setDoChain(boolean doChain)
ServletTestModule.setDoChain(boolean)protected void doFilter()
ServletTestModule.doFilter()protected javax.servlet.ServletRequest getFilteredRequest()
ServletTestModule.getFilteredRequest()protected javax.servlet.ServletResponse getFilteredResponse()
ServletTestModule.getFilteredResponse()protected void clearOutput()
ServletTestModule.clearOutput()protected void init()
ServletTestModule.init()protected void service()
ServletTestModule.service()Copyright © 2003-2015. All Rights Reserved.