public abstract class AbstractTestSet extends AbstractTestCollection
Set methods and contracts.
Since Set doesn't stipulate much new behavior that isn't already found in Collection, this
class basically just adds tests for Set.equals(java.lang.Object) and Set.hashCode() along with an updated
verify() that ensures elements do not appear more than once in the set.
To use, subclass and override the makeEmptySet() method. You may have to override other protected
methods if your set is not modifiable, or if your set restricts what kinds of elements may be added; see
AbstractTestCollection for more details.
collection, confirmedCOLLECTIONS_MAJOR_VERSION| Constructor and Description |
|---|
AbstractTestSet(String name)
JUnit constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Set |
getConfirmedSet()
Return the
AbstractTestCollection.confirmed fixture, but cast as a Set. |
Set |
getSet()
Return the
AbstractTestCollection.collection fixture, but cast as a Set. |
boolean |
isEqualsCheckable()
Set equals method is defined.
|
Collection |
makeCollection()
Makes an empty collection by invoking
makeEmptySet(). |
Collection |
makeConfirmedCollection()
Returns an empty Set for use in modification testing.
|
Collection |
makeConfirmedFullCollection()
Returns a full Set for use in modification testing.
|
abstract Set |
makeEmptySet()
Makes an empty set.
|
Collection |
makeFullCollection()
Makes a full collection by invoking
makeFullSet(). |
Set |
makeFullSet()
Makes a full set by first creating an empty set and then adding all the elements returned by
AbstractTestCollection.getFullElements(). |
void |
testSetEquals()
Tests
Set.equals(Object). |
void |
testSetHashCode()
Tests
Set.hashCode(). |
void |
verify()
Provides additional verifications for sets.
|
areEqualElementsDistinguishable, cloneMapEntry, getFullElements, getFullNonNullElements, getFullNonNullStringElements, getOtherElements, getOtherNonNullElements, getOtherNonNullStringElements, isAddSupported, isFailFastSupported, isNullSupported, isRemoveSupported, makeObject, resetEmpty, resetFull, testCollectionAdd, testCollectionAddAll, testCollectionClear, testCollectionContains, testCollectionContainsAll, testCollectionIsEmpty, testCollectionIterator, testCollectionIteratorFailFast, testCollectionIteratorRemove, testCollectionRemove, testCollectionRemoveAll, testCollectionRetainAll, testCollectionSize, testCollectionToArray, testCollectionToArray2, testCollectionToString, testSerializeDeserializeThenCompare, testUnsupportedAdd, testUnsupportedRemovegetCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, isTestSerialization, readExternalFormFromBytes, readExternalFormFromDisk, skipSerializedCanonicalTests, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testEqualsNull, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDiskclone, ignoredTests, makeSuite, toStringassertEquals, 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, tearDownpublic AbstractTestSet(String name)
name - name for testpublic void verify()
verify in class AbstractTestCollectionpublic boolean isEqualsCheckable()
isEqualsCheckable in class AbstractTestCollectionpublic Collection makeConfirmedCollection()
makeConfirmedCollection in class AbstractTestCollectionpublic Collection makeConfirmedFullCollection()
makeConfirmedFullCollection in class AbstractTestCollectionpublic abstract Set makeEmptySet()
public Set makeFullSet()
AbstractTestCollection.getFullElements(). Override if your set does not support the add operation.public final Collection makeCollection()
makeEmptySet().makeCollection in class AbstractTestCollectionpublic final Collection makeFullCollection()
makeFullSet().makeFullCollection in class AbstractTestCollectionpublic Set getSet()
AbstractTestCollection.collection fixture, but cast as a Set.public Set getConfirmedSet()
AbstractTestCollection.confirmed fixture, but cast as a Set.public void testSetEquals()
Set.equals(Object).public void testSetHashCode()
Set.hashCode().Copyright © 2015-2016 Eclipse Foundation. All Rights Reserved.