|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.diasparsoftware.util.junit.ValueObjectEqualsTest
Constructor Summary | |
ValueObjectEqualsTest()
|
Method Summary | |
protected static void |
assertNotEquals(java.lang.Object lhs,
java.lang.Object rhs)
|
protected static void |
assertNotEquals(java.lang.String failureMessage,
java.lang.Object lhs,
java.lang.Object rhs)
|
protected abstract java.lang.Object |
createControlInstance()
Creates the "control" instance of the class under test — the object against which all the others are to be compared. |
protected abstract java.lang.Object |
createInstanceDiffersIn(java.lang.String keyPropertyName)
Creates and returns an instance of the class under test that differs from the control instance by having a different value for the specified key property. |
protected abstract java.util.List |
keyPropertyNames()
The names of the key properties used to distinguish unequal instances of this class. |
protected void |
setUp()
|
void |
testEqualsAgainstNewObject()
Tests whether equals holds up against a new
Object (should always be false ). |
void |
testEqualsAgainstNull()
Tests whether equals holds up against null . |
void |
testEqualsAgainstUnequalObjects()
Tests whether equals holds up against objects that should
not compare equal. |
void |
testEqualsIsConsistentAcrossInvocations()
Tests whether equals is consistent. |
void |
testEqualsIsReflexive()
Tests whether equals is reflexive. |
void |
testEqualsIsSymmetricAndTransitive()
Tests whether equals is symmetric and
transitive. |
void |
testHashCodeContract()
Tests the hashCode contract. |
void |
testHashCodeIsConsistentAcrossInvocations()
Tests the consistency of hashCode . |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ValueObjectEqualsTest()
Method Detail |
protected abstract java.lang.Object createControlInstance() throws java.lang.Exception
java.lang.Exception
protected abstract java.lang.Object createInstanceDiffersIn(java.lang.String keyPropertyName) throws java.lang.Exception
java.lang.Exception
protected abstract java.util.List keyPropertyNames()
protected void setUp() throws java.lang.Exception
java.lang.Exception
public final void testEqualsAgainstNewObject()
equals
holds up against a new
Object
(should always be false
).
public final void testEqualsAgainstNull()
equals
holds up against null
.
public final void testEqualsAgainstUnequalObjects()
equals
holds up against objects that should
not compare equal.
public final void testEqualsIsConsistentAcrossInvocations()
equals
is consistent.
public final void testEqualsIsReflexive()
equals
is reflexive.
public final void testEqualsIsSymmetricAndTransitive()
equals
is symmetric and
transitive.
public final void testHashCodeContract()
hashCode
contract.
public final void testHashCodeIsConsistentAcrossInvocations()
hashCode
.
protected static void assertNotEquals(java.lang.Object lhs, java.lang.Object rhs)
protected static void assertNotEquals(java.lang.String failureMessage, java.lang.Object lhs, java.lang.Object rhs)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |