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 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, writeExternalFormToDisk
clone, ignoredTests, makeSuite, toString
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown
public AbstractTestBag(java.lang.String testName)
testName
- the test class namepublic abstract Bag makeBag()
public java.lang.Object makeObject()
makeObject
in class AbstractTestObject
public 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.IOException
java.lang.ClassNotFoundException
public void testFullBagSerialization() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void testEmptyBagCompatibility() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void testFullBagCompatibility() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
Copyright © 2001-2016 Apache Software Foundation. All Rights Reserved.