When testing DAOs and data services, the test I most often perform is
order-independent collection equality*.
This is because the database (via Hibernate) may return objects in an arbitrary
order.
I wrote a Matcher that matches collections with the same elements regardless of
order. It handles duplicate elements as well (the number of occurrences must
match).
* aka bag-wise equality.
Original issue reported on code.google.com by me%jnova...@gtempaccount.com on 17 Oct 2011 at 1:05
Original issue reported on code.google.com by
me%jnova...@gtempaccount.com
on 17 Oct 2011 at 1:05