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 that they are all
up to date.
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.
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 Parameters: createNewSession - true creates a new session,false uses the session from factory See Also:com.mockrunner.base.BaseTestCase.createWebMockObjectFactory(WebMockObjectFactoryboolean)
public ActionMapping prepareActionMapping(Class mappingClass)(Code)
Prepares an ActionMapping. If your actions rely
on a custom subclass of ActionMapping, use this
method to prepare it. Since
com.mockrunner.struts.ActionTestModule relies on the behaviour of
com.mockrunner.mock.web.MockActionMapping ,
this method creates a subclass CGLib proxy of the specified mapping class.
You can cast the returned ActionMapping to your custom
mapping class and the subclass proxy will redirect the necessary
methods to the
com.mockrunner.mock.web.MockActionMapping .
Redirected are methods for retrieving forwards. If an ActionMapping
is prepared,
ActionMockObjectFactory.getActionMapping returns the prepared mapping while
ActionMockObjectFactory.getMockActionMapping returns the the underlying
com.mockrunner.mock.web.MockActionMapping .
This method relies on CGLib. CGLib is not required by the Struts test framework
if this method is not used.
Parameters: mappingClass - the class of the custom action mapping an instance of the custom action mapping class