Method Summary |
|
public ActionForward | actionPerform(Class action) Calls the action of the specified type using
no ActionForm . |
public ActionForward | actionPerform(Action action) Calls the specified action using
no ActionForm . |
public ActionForward | actionPerform(Class action, Class form) Calls the action of the specified type using
the ActionForm of the specified type. |
public ActionForward | actionPerform(Action action, Class form) Calls the specified action using
the ActionForm of the specified type. |
public ActionForward | actionPerform(Class action, ActionForm form) Calls the action of the specified type using
the specified ActionForm object. |
public ActionForward | actionPerform(Action action, ActionForm form) Calls the specified action using
the specified ActionForm object. |
public void | addExceptionHandler(ExceptionHandlerConfig handler) Registers an exception handler. |
public String | addMappedPropertyRequestPrefix(String property) Convenience method for map backed properties. |
public ActionForm | createActionForm(Class form) Creates a new ActionForm object of the specified
type and sets it as the current ActionForm . |
public DynaActionForm | createDynaActionForm(FormBeanConfig formConfig) Creates a new DynaActionForm based on the specified
form config and sets it as the current ActionForm . |
public ValidatorResources | createValidatorResources(String[] resourcesFiles) Creates a valid ValidatorResources object based
on the specified config files. |
public void | generateValidToken() Generates a token and sets it to the session and the request. |
public ActionMessage | getActionErrorByKey(String errorKey) Returns the action error with the specified key or null
if such an error does not exist. |
public ActionMessages | getActionErrors() Get the currently present action errors. |
public ActionMessages | getActionErrorsFromRequest() Get the currently present action errors from the request. |
public ActionMessages | getActionErrorsFromSession() Get the currently present action errors from the session. |
public ActionForm | getActionForm() Returns the current ActionForm . |
public MockActionForward | getActionForward() Returns the current ActionForward . |
public ActionMapping | getActionMapping() Delegates to
com.mockrunner.mock.web.ActionMockObjectFactory.getActionMapping . |
public ActionMessage | getActionMessageByKey(String messageKey) Returns the action message with the specified key or null
if such a message does not exist. |
public ActionMessages | getActionMessages() Get the currently present action messages. |
public ActionMessages | getActionMessagesFromRequest() Get the currently present action messages from the request. |
public ActionMessages | getActionMessagesFromSession() Get the currently present action messages from the session. |
public Action | getLastAction() Returns the last tested Action object. |
public MockActionMapping | getMockActionMapping() Delegates to
com.mockrunner.mock.web.ActionMockObjectFactory.getMockActionMapping . |
public MockPageContext | getMockPageContext() Returns the MockPageContext object. |
public String | getOutput() Returns the HTML output as a string (if the action creates HTML output). |
public boolean | hasActionErrors() Returns if action errors are present. |
public boolean | hasActionMessages() Returns if action messages are present. |
public void | populateRequestToForm() Populates the current request parameters to the
ActionForm . |
public void | setActionErrors(ActionMessages errors) Sets the specified ActionErrors object
as the currently present errors to the request. |
public void | setActionErrorsToSession(ActionMessages errors) Sets the specified ActionErrors object
as the currently present errors to the session. |
public void | setActionForm(ActionForm formObj) Sets the specified ActionForm object as the
current ActionForm . |
public void | setActionMessages(ActionMessages messages) Sets the specified ActionMessages object
as the currently present messages to the request. |
public void | setActionMessagesToSession(ActionMessages messages) Sets the specified ActionMessages object
as the currently present messages to the session. |
public void | setDataSource(DataSource dataSource) Sets the specified DataSource . |
public void | setDataSource(String key, DataSource dataSource) Sets the specified DataSource . |
public void | setDoPopulate(boolean doPopulate) Set if the form should be populated with the request
parameters before calling the action. |
public void | setErrorAttributeKey(String errorAttributeKey) Name of the key under which errors are stored. |
public void | setInput(String input) Sets the input attribute. |
public void | setLocale(Locale locale) Sets the specified locale as a session attribute
using Globals.LOCALE_KEY as the key. |
public void | setMessageAttributeKey(String messageAttributeKey) Name of the key under which messages are stored. |
public void | setParameter(String parameter) Sets the parameter by calling ActionMapping.setParameter
on the action mapping returned by
ActionTestModule.getActionMapping . |
public void | setRecognizeMessagesInSession(boolean recognizeInSession) Set if messages that are saved to the session (instead of
the request) should be recognized. |
public void | setReset(boolean reset) Set if the reset method should be called before
populating a form with
ActionTestModule.populateRequestToForm . |
public void | setResources(MessageResources resources) Sets the specified messages resources as a request attribute
using Globals.MESSAGES_KEY as the key. |
public void | setResources(String key, MessageResources resources) Sets the specified messages resources as a servlet context
attribute using the specified key and the module config prefix.
You can use this method, if your action calls
Action.getResources(HttpServletRequest, String) .
Please note that the
com.mockrunner.mock.web.MockModuleConfig is set by Mockrunner as the current module. |
public void | setValidate(boolean validate) Sets if form validation should be performed before calling the action.
Calls ActionMapping.setValidate on the action mapping returned
by
ActionTestModule.getActionMapping . |
public void | setValidatorResources(ValidatorResources validatorResources) Sets the specified ValidatorResources . |
public void | verifyActionErrorNotPresent(String errorKey) Verifies that an action error with the specified key
is not present. |
public void | verifyActionErrorPresent(String errorKey) Verifies that an action error with the specified key
is present. |
public void | verifyActionErrorProperty(String errorKey, String property) Verifies that the specified error is stored for the specified
property. |
public void | verifyActionErrorValue(String errorKey, Object value) Verifies the value of the action error with the
specified key. |
public void | verifyActionErrorValues(String errorKey, Object[] values) Verifies the values of the action error with the
specified key. |
public void | verifyActionErrors(String errorKeys) Verifies that the specified action errors are present. |
public void | verifyActionMessageNotPresent(String messageKey) Verifies that an action message with the specified key
is not present. |
public void | verifyActionMessagePresent(String messageKey) Verifies that an action message with the specified key
is present. |
public void | verifyActionMessageProperty(String messageKey, String property) Verifies that the specified message is stored for the specified
property. |
public void | verifyActionMessageValue(String messageKey, Object value) Verifies the value of the action message with the
specified key. |
public void | verifyActionMessageValues(String messageKey, Object[] values) Verifies the values of the action message with the
specified key. |
public void | verifyActionMessages(String messageKeys) Verifies that the specified action messages are present. |
public void | verifyForward(String path) Verifies the forward path returned by the action.
If your action uses mapping.findForward("success")
to find the forward, you can use this method or
ActionTestModule.verifyForwardName to test the success forward
name. |
public void | verifyForwardName(String name) Verifies the forward name returned by the action.
If your action uses mapping.findForward("success")
to find the forward, you can use this method or
ActionTestModule.verifyForward to test the success forward
name. |
public void | verifyHasActionErrors() Verifies that there are action errors present. |
public void | verifyHasActionMessages() Verifies that there are action messages present. |
public void | verifyNoActionErrors() Verifies that there are no action errors present. |
public void | verifyNoActionMessages() Verifies that there are no action messages present. |
public void | verifyNumberActionErrors(int number) Verifies the number of action errors. |
public void | verifyNumberActionMessages(int number) Verifies the number of action messages. |
public void | verifyRedirect(boolean redirect) Verifies the redirect attribute. |