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 voidVerifies that the "equals" implementation of the given object is reflexive.static voidassertEqualsIsSymmetric(Object obj1, Object obj2) Verifies that the "equals" implementation of the given objects is symmetric.static voidassertEqualsIsTransitive(Object obj1, Object obj2, Object obj3) Verifies that the "equals" implementation of the given objects is transitive.static voidVerifies that the "equals" implementation of the given object returnsfalsewhen the object is compared tonull.static voidassertMaintainsEqualsAndHashCodeContract(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 returnsfalsewhen the object is compared tonull.- Parameters:
obj- the object to verify.- Throws:
AssertionError- if the "equals" implementation of the given objects returnstruewhen 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:
-