public abstract class AbstractTestBag extends AbstractTestObject
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.
COLLECTIONS_MAJOR_VERSION| Constructor and Description |
|---|
AbstractTestBag(java.lang.String testName)
JUnit constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract org.apache.commons.collections.Bag |
makeBag()
Return a new, empty bag to used for testing.
|
java.lang.Object |
makeObject()
Implements the superclass method to return the Bag.
|
void |
testBagAdd() |
void |
testBagEqualsSelf() |
void |
testContains() |
void |
testContainsAll() |
void |
testEmptyBagCompatibility()
Compare the current serialized form of the Bag
against the canonical version in CVS.
|
void |
testEmptyBagSerialization() |
void |
testEquals() |
void |
testEqualsHashBag() |
void |
testFullBagCompatibility()
Compare the current serialized form of the Bag
against the canonical version in CVS.
|
void |
testFullBagSerialization() |
void |
testHashCode() |
void |
testIterator() |
void |
testIteratorFail() |
void |
testIteratorFailDoubleRemove() |
void |
testIteratorFailNoMore() |
void |
testIteratorRemoveProtectsInvariants() |
void |
testRemove() |
void |
testRemoveAll() |
void |
testRetainAll() |
void |
testSize() |
void |
testToArray() |
void |
testToArrayPopulate() |
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, isEqualsCheckable, isTestSerialization, readExternalFormFromBytes, readExternalFormFromDisk, skipSerializedCanonicalTests, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testEqualsNull, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSerializeDeserializeThenCompare, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDiskclone, ignoredTests, makeSuite, toStringpublic AbstractTestBag(java.lang.String testName)
testName - the test class namepublic abstract org.apache.commons.collections.Bag makeBag()
public java.lang.Object makeObject()
makeObject in class AbstractTestObjectpublic void testBagAdd()
public void testBagEqualsSelf()
public void testRemove()
public void testRemoveAll()
public void testContains()
public void testContainsAll()
public void testSize()
public void testRetainAll()
public void testIterator()
public void testIteratorFail()
public void testIteratorFailNoMore()
public void testIteratorFailDoubleRemove()
public void testIteratorRemoveProtectsInvariants()
public void testToArray()
public void testToArrayPopulate()
public void testEquals()
public void testEqualsHashBag()
public void testHashCode()
public void testEmptyBagSerialization()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void testFullBagSerialization()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void testEmptyBagCompatibility()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void testFullBagCompatibility()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionCopyright © 2001-2015 Apache Software Foundation. All Rights Reserved.