From: Steve F. <st...@m3...> - 2003-08-18 20:01:22
|
Tony Obermeit wrote: > Thanks so much for your quick reply, I really appreciate you taking the > time to respond. > It seems to me that with the Mock HttpServletRequest, I have to predict > all the calls that will be made to the mock object. In the case of the > code above, the calls were made by a utility method that parses > httpRequestParameters and returns the value regardless of case, that is > why the getParameter snippet above had to be called twice. > > Is there any way to avoid having to predict all the calls that will be > made? The short answer is no, because that's the point of what you're testing. That said, you can use setup methods, rather than expectation, if you just want to get the thing to work and don't want to check the calls. We have some ideas about how to make things more flexible in the dynamic mock world. > Additionally, I'd like to contribute my Case Study of using the older > MockHttpServletRequest object along with using the new dynamic Mock in > the same context, what is the protocol within this group for making such > a contribution. Do you simply want me to create my own topic within the > wiki or do you want the entire code from my Case Study possibly put into > an examples package? I have a unit test class that has 9 distinct tests > for the utility parseParameter method I wrote in order to study > implementation of mock objects. Would you like to write it up on the wiki? We don't need all the code, just enough to make the point. Thanks S. |