org.apache.commons.collections.bag

Class AbstractTestBag

public abstract class AbstractTestBag extends AbstractTestObject

Abstract test class for org.apache.commons.collections.Bag Bag methods and contracts.

To use, simply extend this class, and implement the AbstractTestBag 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.

Constructor Summary
AbstractTestBag(String testName)
JUnit constructor.
Method Summary
abstract BagmakeBag()
Return a new, empty bag to used for testing.
ObjectmakeObject()
Implements the superclass method to return the Bag.
voidtestBagAdd()
voidtestBagEqualsSelf()
voidtestContains()
voidtestContainsAll()
voidtestEmptyBagCompatibility()
Compare the current serialized form of the Bag against the canonical version in CVS.
voidtestEmptyBagSerialization()
voidtestEquals()
voidtestEqualsHashBag()
voidtestFullBagCompatibility()
Compare the current serialized form of the Bag against the canonical version in CVS.
voidtestFullBagSerialization()
voidtestHashCode()
voidtestIterator()
voidtestIteratorFail()
voidtestIteratorFailDoubleRemove()
voidtestIteratorFailNoMore()
voidtestIteratorRemoveProtectsInvariants()
voidtestRemove()
voidtestRemoveAll()
voidtestRetainAll()
voidtestSize()
voidtestToArray()
voidtestToArrayPopulate()

Constructor Detail

AbstractTestBag

public AbstractTestBag(String testName)
JUnit constructor.

Parameters: testName the test class name

Method Detail

makeBag

public abstract Bag makeBag()
Return a new, empty bag to used for testing.

Returns: the bag to be tested

makeObject

public Object makeObject()
Implements the superclass method to return the Bag.

Returns: the bag to be tested

testBagAdd

public void testBagAdd()

testBagEqualsSelf

public void testBagEqualsSelf()

testContains

public void testContains()

testContainsAll

public void testContainsAll()

testEmptyBagCompatibility

public void testEmptyBagCompatibility()
Compare the current serialized form of the Bag against the canonical version in CVS.

testEmptyBagSerialization

public void testEmptyBagSerialization()

testEquals

public void testEquals()

testEqualsHashBag

public void testEqualsHashBag()

testFullBagCompatibility

public void testFullBagCompatibility()
Compare the current serialized form of the Bag against the canonical version in CVS.

testFullBagSerialization

public void testFullBagSerialization()

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()
Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.