#12 Reset action errors between HTTP requests

open
nobody
None
5
2003-11-20
2003-11-20
Fabian Gonzales
No

I have a situation where I want to invoke two HTTP
requests in the same test (first a create action, then a
delete action).

However, if the first action sets any action errors, these
are carried over to the second request, causing
verifyNoActionErrors() to fail, even though the second
request added no new errors.

I would like to have the option to reset action errors
between requests.

I solved this for now by adding the following line to
setRequestPathInfo():

// Reset the list of action errors
request.setAttribute(Globals.ERROR_KEY, new
ActionMessages());

However, this is just a quick fix. Strictly speaking, not
only action errors should be reset between requests, but
action messages in general, as well as other request
attributes, at least as an option.

Discussion