On 19-12-2008 at 06:49, Asleson, Ryan wrote: > From what I can see there's one problem with MockRoundTrip: I can tell > it the class of the ActionBean I want to test, but I can't pass to it an > instance of an ActionBean. Instead, it seems to rely on creating an > ActionBean instance when the round trip is executed. This doesn't work > for me, as I need to create an instance of the ActionBean myself so I > can set mock collaborators on it. My ActionBeans use Spring beans, and > in my unit tests I mock out these Spring beans with EasyMock and inject > them myself into the ActionBean under test. > > Since MockRoundTrip creates an instance of the ActionBean on the fly, > and doesn't let me create my own instance of the ActionBean, I can't set > mock objects on the ActionBean. > > Is this correct, and if so, can you recommend any work around?
This is correct, but IIRC the MockROundTrip does a full cycle: filters, servlets, interceptors, etc. So a correctly configured fixture will have Spring inject the objects as usual -- apart from the fact that Spring uses your mocked objects via EasyMock. The actual configuration for this is too long ago for me though. -- ,-_ Oscar Westra van holthe - Kind http://www.xs4all.nl/~kindop/ /() ) (__ ( I love deadlines. I like the whooshing sound they make as they fly =/ () by. -- Douglas Adams ------------------------------------------------------------------------------ _______________________________________________ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users