com.mockrunner.mock.web
Class ActionMockObjectFactory

java.lang.Object
  extended bycom.mockrunner.mock.web.WebMockObjectFactory
      extended bycom.mockrunner.mock.web.ActionMockObjectFactory

public class ActionMockObjectFactory
extends WebMockObjectFactory

Used to create all types of struts mock objects. Maintains the necessary dependencies between the mock objects. If you use the mock objects returned by this factory in your tests you can be sure, they are all up to date.


Constructor Summary
ActionMockObjectFactory()
          Creates a new set of mock objects.
ActionMockObjectFactory(WebMockObjectFactory factory)
          Creates a set of mock objects based on another one.
ActionMockObjectFactory(WebMockObjectFactory factory, boolean createNewSession)
          Creates a set of mock objects based on another one.
 
Method Summary
 MockActionMapping getMockActionMapping()
          Returns the MockActionMapping.
 MockActionServlet getMockActionServlet()
          Returns the MockModuleConfig.
 MockModuleConfig getMockModuleConfig()
          Returns the MockModuleConfig.
 void refresh()
          Refreshes the mock objects dependencies.
 
Methods inherited from class com.mockrunner.mock.web.WebMockObjectFactory
addRequestWrapper, addRequestWrapper, addResponseWrapper, addResponseWrapper, getMockFilterChain, getMockFilterConfig, getMockPageContext, getMockRequest, getMockResponse, getMockServletConfig, getMockServletContext, getMockSession, getSession, getWrappedRequest, getWrappedResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionMockObjectFactory

public ActionMockObjectFactory()
Creates a new set of mock objects.


ActionMockObjectFactory

public ActionMockObjectFactory(WebMockObjectFactory factory)
Creates a set of mock objects based on another one. The created mock objects will have their own request and session objects, but they will share one ServletContext.

Parameters:
factory - the other factory
See Also:
BaseTestCase.createWebMockObjectFactory(WebMockObjectFactory)

ActionMockObjectFactory

public ActionMockObjectFactory(WebMockObjectFactory factory,
                               boolean createNewSession)
Creates a set of mock objects based on another one. You can specify, if the created mock objects should share the same session. They will share one ServletContext anyway.

Parameters:
factory - the other factory
createNewSession - true creates a new session, false uses the session from factory
See Also:
BaseTestCase.createWebMockObjectFactory(WebMockObjectFactory, boolean)
Method Detail

refresh

public void refresh()
Refreshes the mock objects dependencies. May be called after setting request and response wrappers.

Overrides:
refresh in class WebMockObjectFactory

getMockActionMapping

public MockActionMapping getMockActionMapping()
Returns the MockActionMapping.

Returns:
the MockActionMapping

getMockModuleConfig

public MockModuleConfig getMockModuleConfig()
Returns the MockModuleConfig.

Returns:
the MockModuleConfig

getMockActionServlet

public MockActionServlet getMockActionServlet()
Returns the MockModuleConfig.

Returns:
the MockModuleConfig