From: Jeff M. <je...@cu...> - 2003-07-17 08:42:46
|
Should probably be a ReturnObjectBag as this lets you setup a list of return values for a key. On Thu, 2003-07-17 at 08:47, Steve Freeman wrote: > This implementation /is/ a little hazy. > > The idea is that you should preload your attributes in the order in > which they are requested, and then they'll just be returned as the code > runs. It's not actually doing a lookup. Checking which attributes are > asked for is actually a separate concept and handled by a different > expectation. There are some arguments for doing this but it does look a > little clumsy. > > If you don't like this, I suggest you replace this part of the mock > request with an ExpectationMap which might be closer to the behaviour > you want. > > S. > > Bill Lynch wrote: > > All, > > > > I haven't been able to figure out how to set attributes in a > > MockHttpServletRequest. I searched the mailing list archives for clues, > > but didn't find any (and there's no javadocs for that class!). > > > > The method that looks like it might work only takes one param: > > > > request.setupGetAttribute(Object) > > > > I'd expect that to be > > > > request.setupGetAttribute(String, Object) > > > > I've also tried passing in a vector of name/value pairs to that method, > > but when I call getAttribute(String) on that request object I get this > > error: > > > > There was 1 failure: > > 1) > > testGetAttribute(com.foo.util.MyTest)junit.framework.AssertionFailedError: > > attributes has run out of objects. > > at > > com.mockobjects.ReturnObjectList.nextReturnObject(ReturnObjectList.java:61) > > at > > com.mockobjects.servlet.MockHttpServletRequest.getAttribute(MockHttpServletRequest.java:58) > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the > same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > Mockobjects-java-users mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-users -- Jeff Martin Memetic Engineer http://www.custommonkey.org/ |