Package org.fest.test
Class EqualsHashCodeContractAssert
java.lang.Object
org.fest.test.EqualsHashCodeContractAssert
Understands assert methods for
EqualsHashCodeContractTestCase
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
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
Verifies that the "equals" implementation of the given object returnsfalse
when the object is compared tonull
.static void
assertMaintainsEqualsAndHashCodeContract
(Object obj1, Object obj2) Verifies that the "equals/hashCode" contract of the given objects is implemented correctly.
-
Constructor Details
-
EqualsHashCodeContractAssert
private EqualsHashCodeContractAssert()
-
-
Method Details
-
assertIsNotEqualToNull
Verifies that the "equals" implementation of the given object returnsfalse
when the object is compared tonull
.- Parameters:
obj
- the object to verify.- Throws:
AssertionError
- if the "equals" implementation of the given objects returnstrue
when the object compared tonull
.- See Also:
-
assertEqualsIsReflexive
Verifies that the "equals" implementation of the given object is reflexive.- Parameters:
obj
- the object to verify.- Throws:
AssertionError
- if the "equals" implementation of the given object is reflexive.- See Also:
-
assertEqualsIsSymmetric
Verifies that the "equals" implementation of the given objects is symmetric.- Parameters:
obj1
- the object to verify.obj2
- the object to compare to.- Throws:
AssertionError
- if the "equals" implementation of the given object is not symmetric.- See Also:
-
assertEqualsIsTransitive
Verifies that the "equals" implementation of the given objects is transitive.- Parameters:
obj1
- the object to verify.obj2
- an object to compare to.obj3
- an object to compare to.- Throws:
AssertionError
- if the "equals" implementation of the given objects is not transitive.- See Also:
-
assertMaintainsEqualsAndHashCodeContract
Verifies that the "equals/hashCode" contract of the given objects is implemented correctly.- Parameters:
obj1
- the object to verify.obj2
- the object to compare to.- Throws:
AssertionError
- if the "equals/hashCode" contract of the given objects is not implemented correctly.- See Also:
-