net.sourceforge.stripes.mock
Class MockRequestDispatcher

java.lang.Object
  extended by net.sourceforge.stripes.mock.MockRequestDispatcher
All Implemented Interfaces:
RequestDispatcher

public class MockRequestDispatcher
extends Object
implements RequestDispatcher

Mock implementation of a RequesetDispatcher used for testing purposes. Note that the mock implementation does not support actually forwarding the request, or including other resources. The methods are implemented to record that a forward/include took place and then simply return.

Since:
Stripes 1.1.1
Author:
Tim Fennell

Constructor Summary
MockRequestDispatcher(String url)
          Constructs a request dispatcher, giving it a handle to the creating request.
 
Method Summary
 void forward(ServletRequest req, ServletResponse res)
          Simply stores the URL that was requested for forward, and returns.
 MockHttpServletRequest getMockRequest(ServletRequest request)
          Locates the MockHttpServletRequest in case it is wrapped.
 void include(ServletRequest req, ServletResponse res)
          Simply stores that the URL was included an then returns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockRequestDispatcher

public MockRequestDispatcher(String url)
Constructs a request dispatcher, giving it a handle to the creating request.

Method Detail

forward

public void forward(ServletRequest req,
                    ServletResponse res)
             throws ServletException,
                    IOException
Simply stores the URL that was requested for forward, and returns.

Specified by:
forward in interface RequestDispatcher
Throws:
ServletException
IOException

include

public void include(ServletRequest req,
                    ServletResponse res)
             throws ServletException,
                    IOException
Simply stores that the URL was included an then returns.

Specified by:
include in interface RequestDispatcher
Throws:
ServletException
IOException

getMockRequest

public MockHttpServletRequest getMockRequest(ServletRequest request)
Locates the MockHttpServletRequest in case it is wrapped.



? Copyright 2005-2006, Stripes Development Team.