|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jtiger.assertion.EqualsMethodContract
public final class EqualsMethodContract
Makes assertions on the general contract of the
java.lang.Object equals method.
This requires the creation of an instance of ObjectFactory
to return instances to use to test.
The given ObjectFactory
must meet the its own general contract.
ObjectFactory
,
ObjectFactoryContract
,
HashCodeMethodContract
,
Object.equals(Object)
Method Summary | |
---|---|
static void |
assertEqualsMethodConsistentAcrossInvocations(ObjectFactory<?> factory,
Object... message)
Asserts that the given ObjectFactory returns instances that meet one aspect of the equals method
general contract. |
static void |
assertEqualsMethodFillsContract(ObjectFactory<?> factory,
Object... message)
Asserts that the given ObjectFactory returns instances that meet the entire equals method general
contract. |
static void |
assertEqualsMethodReflexive(ObjectFactory<?> factory,
Object... message)
Asserts that the given ObjectFactory returns instances that meet one aspect of the equals method
general contract. |
static void |
assertEqualsMethodSymmetric(ObjectFactory<?> factory,
Object... message)
Asserts that the given ObjectFactory returns instances that meet one aspect of the equals method
general contract. |
static void |
assertEqualsMethodTransitive(ObjectFactory<?> factory,
Object... message)
Asserts that the given ObjectFactory returns instances that meet one aspect of the equals method
general contract. |
static void |
assertEqualsMethodUnequalToNull(ObjectFactory<?> factory,
Object... message)
Asserts that the given ObjectFactory returns instances that meet one aspect of the equals method
general contract. |
static void |
assertEqualsMethodUnequalToUnequalInstance(ObjectFactory<?> factory,
Object... message)
Asserts that the given ObjectFactory returns instances that meet one aspect of the equals method
general contract. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void assertEqualsMethodUnequalToNull(ObjectFactory<?> factory, Object... message) throws AssertionException
ObjectFactory
returns instances that meet one aspect of the equals method
general contract.
The equals
method must return false
for a null
argument.
factory
- The factory to use to return instances for asserting the aspect of the contract.message
- The assertion message.
AssertionException
- If the given ObjectFactory
returns instances that do not meet the aspect
of the equals method general contract.public static void assertEqualsMethodConsistentAcrossInvocations(ObjectFactory<?> factory, Object... message) throws AssertionException
ObjectFactory
returns instances that meet one aspect of the equals method
general contract.
The equals
method must consistently return true
or false
given the same
argument when called on the same instance.
factory
- The factory to use to return instances for asserting the aspect of the contract.message
- The assertion message.
AssertionException
- If the given ObjectFactory
returns instances that do not meet the aspect
of the equals method general contract.public static void assertEqualsMethodReflexive(ObjectFactory<?> factory, Object... message) throws AssertionException
ObjectFactory
returns instances that meet one aspect of the equals method
general contract.
The equals
method must return true
when given an argument that refers to the same instance
on which the method is called.
factory
- The factory to use to return instances for asserting the aspect of the contract.message
- The assertion message.
AssertionException
- If the given ObjectFactory
returns instances that do not meet the aspect
of the equals method general contract.public static void assertEqualsMethodSymmetric(ObjectFactory<?> factory, Object... message) throws AssertionException
ObjectFactory
returns instances that meet one aspect of the equals method
general contract.
The equals
method must be symmetric.
factory
- The factory to use to return instances for asserting the aspect of the contract.message
- The assertion message.
AssertionException
- If the given ObjectFactory
returns instances that do not meet the aspect
of the equals method general contract.public static void assertEqualsMethodTransitive(ObjectFactory<?> factory, Object... message) throws AssertionException
ObjectFactory
returns instances that meet one aspect of the equals method
general contract.
The equals
method must be transitive.
factory
- The factory to use to return instances for asserting the aspect of the contract.message
- The assertion message.
AssertionException
- If the given ObjectFactory
returns instances that do not meet the aspect
of the equals method general contract.public static void assertEqualsMethodUnequalToUnequalInstance(ObjectFactory<?> factory, Object... message) throws AssertionException
ObjectFactory
returns instances that meet one aspect of the equals method
general contract.
For an instance that has defined unequal semantics, the equals
method must be consistently return
false
.
factory
- The factory to use to return instances for asserting the aspect of the contract.message
- The assertion message.
AssertionException
- If the given ObjectFactory
returns instances that do not meet the aspect
of the equals method general contract.public static void assertEqualsMethodFillsContract(ObjectFactory<?> factory, Object... message) throws AssertionException
ObjectFactory
returns instances that meet the entire equals method general
contract.
The contract is defined by
the java.lang.Object equals method.
factory
- The factory to use to return instances for asserting the entire general contract.message
- The assertion message.
AssertionException
- If the given ObjectFactory
returns instances that do not meet the entire
equals method general contract.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |