From: Jeff D. <Jef...@no...> - 2003-05-01 20:51:18
|
I don't see how MockHttpServlet.getAttribute can work correctly when setAttribute and the getAttribute looking at different collections. This will work fine, if you only plan to set an Attribute or get an Attribute. In my case, I'm chaining two objects implementing a command pattern together. The first command sets some attributes with the standard setAttribute() , but when the next command tries to use getAttribute(). This will call myAttributeValues.getNextReturnObject(), but setAttribute appeared to use myAttributes.addActual(new MapEntry(aKey, aValue)). I don't see how it will find my attribute ever in the second command. It would seem to me that needs to update both of these collections, so the getAttributes would work correctly. Next, I not sure I that getAttribute should use getNetReturnObject, because it appears to requires that the attribute be in the collection. In my usage of the HttpSession, I have a couple places where I test for the existence of the attribute like this (_session.getAttributte("mykey")==null). This will not work, because it will fire off an exception due to the attribute not existing in the myAttributte ReturnObjectBag. I think some of this can be turned off by turning setFailonVerify, but I could not see how MockHttpSession object could do this. Regards, Jeff Duska |