Abstract test class for
Bag
methods and contracts.
To use, simply extend this class, and implement
the
makeBag()
method.
If your bag fails one of these tests by design,
you may still use this base set of cases. Simply override the
test case (method) your bag fails.
makeBag
public abstract Bag makeBag()
Return a new, empty bag to used for testing.
makeObject
public Object makeObject()
Implements the superclass method to return the Bag.
testBagAdd
public void testBagAdd()
testBagEqualsSelf
public void testBagEqualsSelf()
testContains
public void testContains()
testContainsAll
public void testContainsAll()
testEmptyBagCompatibility
public void testEmptyBagCompatibility()
throws IOException,
ClassNotFoundException
Compare the current serialized form of the Bag
against the canonical version in CVS.
testEmptyBagSerialization
public void testEmptyBagSerialization()
throws IOException,
ClassNotFoundException
testEquals
public void testEquals()
testEqualsHashBag
public void testEqualsHashBag()
testFullBagCompatibility
public void testFullBagCompatibility()
throws IOException,
ClassNotFoundException
Compare the current serialized form of the Bag
against the canonical version in CVS.
testFullBagSerialization
public void testFullBagSerialization()
throws IOException,
ClassNotFoundException
testHashCode
public void testHashCode()
testIterator
public void testIterator()
testIteratorFail
public void testIteratorFail()
testIteratorFailDoubleRemove
public void testIteratorFailDoubleRemove()
testIteratorFailNoMore
public void testIteratorFailNoMore()
testIteratorRemoveProtectsInvariants
public void testIteratorRemoveProtectsInvariants()
testRemove
public void testRemove()
testRemoveAll
public void testRemoveAll()
testRetainAll
public void testRetainAll()
testSize
public void testSize()
testToArray
public void testToArray()
testToArrayPopulate
public void testToArrayPopulate()