Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mockobjects.helpers
Class ServletTestHelper  view ServletTestHelper download ServletTestHelper.java

java.lang.Object
  extended bycom.mockobjects.helpers.AbstractServletTestHelper
      extended bycom.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


Field Summary
private  javax.servlet.http.HttpServlet testSubject
           
 
Fields inherited from class com.mockobjects.helpers.AbstractServletTestHelper
httpSession, request, requestDispatcher, response, servletConfig, servletContext
 
Constructor Summary
ServletTestHelper(javax.servlet.http.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testSubject

private final javax.servlet.http.HttpServlet testSubject
Constructor Detail

ServletTestHelper

public ServletTestHelper(javax.servlet.http.HttpServlet testSubject)
Method Detail

testServletInit

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


testServlet

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


testDoPost

public void testDoPost()
                throws javax.servlet.ServletException,
                       java.io.IOException

testDoGet

public void testDoGet()
               throws javax.servlet.ServletException,
                      java.io.IOException