Package com.mockobjects.helpers
Class ServletTestHelper
- java.lang.Object
-
- com.mockobjects.helpers.AbstractServletTestHelper
-
- com.mockobjects.helpers.ServletTestHelper
-
public class ServletTestHelper extends AbstractServletTestHelper
Sets up mock servlet objects in a common configuration. HttpSession is attached to request, RequestDispatcher is connected to HttpSession
-
-
Constructor Summary
Constructors Constructor Description ServletTestHelper(HttpServlet testSubject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestDoGet()voidtestDoPost()voidtestServlet()Calls HttpServlet.service passing it the MockHttpServletRequest & MockHttpServletResponsevoidtestServletInit()Calls HttpServlet.init passing it the MockServletConfig-
Methods inherited from class com.mockobjects.helpers.AbstractServletTestHelper
getHttpSession, getRequest, getRequestDispatcher, getResponse, getServletConfig, getServletContext
-
-
-
-
Method Detail
-
testServletInit
public void testServletInit() throws ServletExceptionCalls HttpServlet.init passing it the MockServletConfig- Throws:
ServletException
-
testServlet
public void testServlet() throws ServletException, java.io.IOExceptionCalls HttpServlet.service passing it the MockHttpServletRequest & MockHttpServletResponse- Throws:
ServletExceptionjava.io.IOException
-
testDoPost
public void testDoPost() throws ServletException, java.io.IOException- Throws:
ServletExceptionjava.io.IOException
-
testDoGet
public void testDoGet() throws ServletException, java.io.IOException- Throws:
ServletExceptionjava.io.IOException
-
-