At 5:13 PM +0000 11/23/04, Gareth Webbley wrote:
I don't know if this is the correct way to do it but if you call
setupGetAttribute on the MockServletContext with the key that you require and
a null value, when the code you want to test calls getAttribute it will get a
null value (which I assume is what you want in the test) and the
AssertionFailedError will not be seen.


I think the idea is you call setupGetAttribute with each attribute you expect
the code you are testing to try to get even if you want the code to receive a
null value.  If the code attempts to get an attribute which you haven't told
the MockServletContext about you get the AssertionFailedError.

Gareth:

This moved me further, but only to another error:
1) testActionCaching(org.apache.struts.chain.TestCreateAction)junit.framework.AssertionFailedError: attributes.actions has run out of objects.


The JavaDoc for the Mock servlet objects is hopeless. Can you point to any other good docs for using the MockObjects for servlet testing?

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex

Reply via email to