public final class EqualsHashCodeContractAssert extends Object
EqualsHashCodeContractTestCase.| Modifier and Type | Method and Description |
|---|---|
static void |
assertEqualsIsReflexive(Object obj)
Verifies that the "equals" implementation of the given object is reflexive.
|
static void |
assertEqualsIsSymmetric(Object obj1,
Object obj2)
Verifies that the "equals" implementation of the given objects is symmetric.
|
static void |
assertEqualsIsTransitive(Object obj1,
Object obj2,
Object obj3)
Verifies that the "equals" implementation of the given objects is transitive.
|
static void |
assertIsNotEqualToNull(Object obj)
Verifies that the "equals" implementation of the given object returns
false when the object is
compared to null. |
static void |
assertMaintainsEqualsAndHashCodeContract(Object obj1,
Object obj2)
Verifies that the "equals/hashCode" contract of the given objects is implemented correctly.
|
public static void assertIsNotEqualToNull(Object obj)
false when the object is
compared to null.obj - the object to verify.AssertionError - if the "equals" implementation of the given objects returns true when the
object compared to null.EqualsHashCodeContractTestCase.should_not_be_equal_to_null()public static void assertEqualsIsReflexive(Object obj)
obj - the object to verify.AssertionError - if the "equals" implementation of the given object is reflexive.EqualsHashCodeContractTestCase.should_have_reflexive_equals()public static void assertEqualsIsSymmetric(Object obj1, Object obj2)
obj1 - the object to verify.obj2 - the object to compare to.AssertionError - if the "equals" implementation of the given object is not symmetric.EqualsHashCodeContractTestCase.should_have_symmetric_equals()public static void assertEqualsIsTransitive(Object obj1, Object obj2, Object obj3)
obj1 - the object to verify.obj2 - an object to compare to.obj3 - an object to compare to.AssertionError - if the "equals" implementation of the given objects is not transitive.EqualsHashCodeContractTestCase.should_have_transitive_equals()public static void assertMaintainsEqualsAndHashCodeContract(Object obj1, Object obj2)
obj1 - the object to verify.obj2 - the object to compare to.AssertionError - if the "equals/hashCode" contract of the given objects is not implemented correctly.EqualsHashCodeContractTestCase.should_maintain_equals_and_hashCode_contract()Copyright © 2008-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.