| com.bm.utils.BeanEqualsTester
BeanEqualsTester | final public class BeanEqualsTester extends Assert (Code) | | Helper method to test the equality of beans.
author: Daniel Wiese |
Method Summary | |
public static void | testColletionsForEqual(Collection<? extends T> firstColl, Collection<? extends T> secondColl) Assert that the two collections are the same irrespective of order. | public static void | testEqualsImplementationForEntityBeans(List<T> original, List<T> readed) Test the collection for equality by calling the equals method (if not
equal a runntime excetion is thrown).
The preconditions are: We expect that the list do not contain duplicate
elements - every element should represent a different row in the
database!
Additional preconditions are: - 2 Entitybeans representing different
database-rows are NEVER equal. | public static void | testEqualsOnPersistentFields(List<T> original, List<T> readed, Introspector<T> intro) Test the collection for equality on persistent fields (if not equal a
runntime excetion is thrown). | public static void | testEqualsOnSize(List<T> original, List<T> readed) Test the collection for the size (if not equal a runntime excetion is. |
testColletionsForEqual | public static void testColletionsForEqual(Collection<? extends T> firstColl, Collection<? extends T> secondColl)(Code) | | Assert that the two collections are the same irrespective of order.
Parameters: firstColl - The first collection Parameters: secondColl - The second collection< Parameters: T - > -the type of the collection |
testEqualsImplementationForEntityBeans | public static void testEqualsImplementationForEntityBeans(List<T> original, List<T> readed)(Code) | | Test the collection for equality by calling the equals method (if not
equal a runntime excetion is thrown).
The preconditions are: We expect that the list do not contain duplicate
elements - every element should represent a different row in the
database!
Additional preconditions are: - 2 Entitybeans representing different
database-rows are NEVER equal. - Every bean instance representing
the same DB row is always equal. - 2 equal beans MUST have the same
hash code. - N bans (e.g 30) should have different hash codes.
< Parameters: T - > -the type of the bean Parameters: original - -the original collection ob beans Parameters: readed - -the readed collection from the DB |
testEqualsOnPersistentFields | public static void testEqualsOnPersistentFields(List<T> original, List<T> readed, Introspector<T> intro)(Code) | | Test the collection for equality on persistent fields (if not equal a
runntime excetion is thrown).
< Parameters: T - > -the type of the bean Parameters: original - -the original collsecion ob beans Parameters: readed - -the readed collection from the DB Parameters: intro - -the introspector |
testEqualsOnSize | public static void testEqualsOnSize(List<T> original, List<T> readed)(Code) | | Test the collection for the size (if not equal a runntime excetion is.
thrown)
< Parameters: T - > -the type of the bean Parameters: original - -the original collsecion ob beans Parameters: readed - -the readed collection from the DB |
|
|