com.mockobjects.helpers

Class 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
See Also:
MockHttpServletRequest.setSession(HttpSession), MockServletContext.setupGetRequestDispatcher(RequestDispatcher)

Constructor Summary

ServletTestHelper(HttpServlet testSubject)

Method Summary

void
testDoGet()
void
testDoPost()
void
testServlet()
Calls HttpServlet.service passing it the MockHttpServletRequest & MockHttpServletResponse
void
testServletInit()
Calls HttpServlet.init passing it the MockServletConfig

Methods inherited from class com.mockobjects.helpers.AbstractServletTestHelper

getHttpSession, getRequest, getRequestDispatcher, getResponse, getServletConfig, getServletContext

Constructor Details

ServletTestHelper

public ServletTestHelper(HttpServlet testSubject)

Method Details

testDoGet

public void testDoGet()
            throws ServletException,
                   IOException

testDoPost

public void testDoPost()
            throws ServletException,
                   IOException

testServlet

public void testServlet()
            throws ServletException,
                   IOException
Calls HttpServlet.service passing it the MockHttpServletRequest & MockHttpServletResponse

testServletInit

public void testServletInit()
            throws ServletException
Calls HttpServlet.init passing it the MockServletConfig

Copyright © 2002 Mock Objects. All Rights Reserved.