Package org.marketcetera.util.test
Class EqualityAssert
- java.lang.Object
-
- org.marketcetera.util.test.EqualityAssert
-
public final class EqualityAssert extends Object
Assertions for equality (and hash code generation).- Since:
- 1.0.0
- Version:
- $Id$
- Author:
- tlerios@marketcetera.com
-
-
Constructor Summary
Constructors Modifier Constructor Description privateEqualityAssert()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertEquality(Object o, int equalIndex, Object... osOther)Asserts that the given target object implements equality correctly.static voidassertEquality(Object o, Object oEqual, Object... osUnequal)Asserts that the given target object implements equality correctly.static voidassertEquality(String message, Object o, int equalIndex, Object... osOther)Asserts that the given target object implements equality correctly.static voidassertEquality(String message, Object o, Object oEqual, Object... osUnequal)Asserts that the given target object implements equality correctly.
-
-
-
Method Detail
-
assertEquality
public static void assertEquality(String message, Object o, Object oEqual, Object... osUnequal)
Asserts that the given target object implements equality correctly. If the assertion does not hold, theAssertionErrorthrown starts with the given message, which may be null if no such custom message prefix is desired.- Parameters:
message- The message.o- The target object.oEqual- Another object that is equal to (but not the same as) the target object.osUnequal- Objects that are all unequal to the target object. It may be null or contain null elements.
-
assertEquality
public static void assertEquality(Object o, Object oEqual, Object... osUnequal)
Asserts that the given target object implements equality correctly.- Parameters:
o- The target object.oEqual- Another object that is equal to (but not the same as) the target object.osUnequal- Objects that are all unequal to the target object. It may be null or contain null elements.
-
assertEquality
public static void assertEquality(String message, Object o, int equalIndex, Object... osOther)
Asserts that the given target object implements equality correctly. If the assertion does not hold, theAssertionErrorthrown starts with the given message, which may be null if no such custom message prefix is desired.- Parameters:
message- The message.o- The target object.equalIndex- The index in the collection below for another object that is equal to (but not the same as) the target object; all other collection items are unequal to the target object.osOther- A nonempty collection of objects.
-
assertEquality
public static void assertEquality(Object o, int equalIndex, Object... osOther)
Asserts that the given target object implements equality correctly.- Parameters:
o- The target object.equalIndex- The index in the collection below for another object that is equal to (but not the same as) the target object; all other collection items are unequal to the target object.osOther- A nonempty collection of objects.
-
-