Just added a new class (ant test) called ReturnObjectBag. This builds on
the ReturnObjectList by mapping ReturnObjectList to key values.
This allows you to fill a map style object (set/getAttribute) with the
lists of the values you want returned for each key. So you can have the
strictness of the ReturnObjectList (You have to use all the objects
within it, in the predefined order) with the unordereness of a map.
I've started to use this within a MockConnection code where you can now
specify the PreparedStatement to return for a piece of sql, whilst make
sure your not making unnecessary calls to prepareStatement.
Since this changes the behavior of MockConnection I've created a new
version called MockConnection2 and deprecated MockConnection eventually
we should be able to move MockConnection2 back to MockConnection once
people have got used to the idea.
I'll also gradually look at some of the other Mocks which have been
bugging me like the servlet mocks which use attributes all over the
shop.
Give me a shout if I've botched anything ;o)
p.s. Is ReturnObjectBag the right name for something like this?
--
Jeff Martin
Memetic Engineer
http://www.custommonkey.org/
|