|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase com.mockrunner.base.BasicWebTestCase com.mockrunner.base.BasicHTMLOutputTestCase com.mockrunner.servlet.BasicServletTestCaseAdapter
public abstract class BasicServletTestCaseAdapter
Delegator for 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
ServletTestCaseAdapter
.
This class is generated from the ServletTestModule
and should not be edited directly.
Constructor Summary | |
---|---|
BasicServletTestCaseAdapter()
|
|
BasicServletTestCaseAdapter(java.lang.String name)
|
Methods inherited from class com.mockrunner.base.BasicHTMLOutputTestCase |
---|
getOutput, getOutputAsBufferedReader, getOutputAsJDOMDocument, getOutputAsW3CDocument, getOutputAsWellformedXML, getWebTestModule, setCaseSensitive, verifyOutput, verifyOutputContains, verifyOutputRegularExpression |
Methods inherited from class com.mockrunner.base.BasicWebTestCase |
---|
addRequestParameter, addRequestParameter, addRequestParameter, getRequestAttribute, getRequestParameter, getSessionAttribute, setRequestAttribute, setSessionAttribute |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicServletTestCaseAdapter()
public BasicServletTestCaseAdapter(java.lang.String name)
Method Detail |
---|
protected void tearDown() throws java.lang.Exception
tearDown
in class junit.framework.TestCase
java.lang.Exception
protected void setUp() throws java.lang.Exception
ServletTestModule
. If you
overwrite this method, you must call super.setUp()
.
setUp
in class junit.framework.TestCase
java.lang.Exception
protected WebMockObjectFactory createWebMockObjectFactory()
WebMockObjectFactory
.
WebMockObjectFactory
protected 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 factory
WebMockObjectFactory
protected WebMockObjectFactory getWebMockObjectFactory()
WebMockObjectFactory
.
WebMockObjectFactory
protected void setWebMockObjectFactory(WebMockObjectFactory webMockObjectFactory)
WebMockObjectFactory
.
webMockObjectFactory
- the WebMockObjectFactory
protected ServletTestModule createServletTestModule()
ServletTestModule
based on the current
WebMockObjectFactory
.
Same as createServletTestModule(getWebMockObjectFactory())
.
ServletTestModule
protected ServletTestModule createServletTestModule(WebMockObjectFactory mockFactory)
ServletTestModule
with the specified
WebMockObjectFactory
.
ServletTestModule
protected HTMLOutputModule getHTMLOutputModule()
ServletTestModule
as
HTMLOutputModule
.
getHTMLOutputModule
in class BasicHTMLOutputTestCase
HTMLOutputModule
protected ServletTestModule getServletTestModule()
ServletTestModule
.
ServletTestModule
protected void setServletTestModule(ServletTestModule servletTestModule)
ServletTestModule
.
servletTestModule
- the ServletTestModule
protected 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(java.lang.Class servletClass)
ServletTestModule.createServlet(Class)
protected javax.servlet.Filter createFilter(java.lang.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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |