Keel 2.1RC2

org.apache.commons.collections
Class TestBinaryHeap

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.commons.collections.BulkTest
              extended byorg.apache.commons.collections.TestObject
                  extended byorg.apache.commons.collections.TestCollection
                      extended byorg.apache.commons.collections.TestBinaryHeap
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test

public class TestBinaryHeap
extends TestCollection

Tests the BinaryHeap.

Version:
$Id: TestBinaryHeap.java,v 1.7 2002/10/13 12:59:52 scolebourne Exp $
Author:

Field Summary
 
Fields inherited from class org.apache.commons.collections.TestCollection
collection, confirmed
 
Fields inherited from class org.apache.commons.collections.TestObject
COLLECTIONS_MAJOR_VERSION
 
Fields inherited from class org.apache.commons.collections.BulkTest
verboseName
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestBinaryHeap(java.lang.String testName)
           
 
Method Summary
 java.lang.Object[] getFullElements()
          Returns an array of objects that are contained in a collection produced by TestCollection.makeFullCollection().
 java.lang.Object[] getOtherElements()
          Returns an array of elements that are not contained in a full collection.
 java.util.Collection makeCollection()
          Return a new, empty Object to used for testing.
 java.util.Collection makeConfirmedCollection()
          Returns a confirmed empty collection.
 java.util.Collection makeConfirmedFullCollection()
          Returns a confirmed full collection.
static junit.framework.Test suite()
           
 void testBasicComparatorOps()
           
 void testBasicOps()
           
 void testCollectionIteratorFailFast()
          Tests that the collection's iterator is fail-fast.
 void verify()
          Verifies that TestCollection.collection and TestCollection.confirmed have identical state.
 
Methods inherited from class org.apache.commons.collections.TestCollection
areEqualElementsDistinguishable, getFullNonNullElements, getFullNonNullStringElements, getOtherNonNullElements, getOtherNonNullStringElements, isAddSupported, isRemoveSupported, makeFullCollection, makeObject, resetEmpty, resetFull, testCollectionAdd, testCollectionAddAll, testCollectionClear, testCollectionContains, testCollectionContainsAll, testCollectionIsEmpty, testCollectionIterator, testCollectionIteratorRemove, testCollectionRemove, testCollectionRemoveAll, testCollectionRetainAll, testCollectionSize, testCollectionToArray, testCollectionToArray2, testCollectionToString, testUnsupportedAdd, testUnsupportedRemove
 
Methods inherited from class org.apache.commons.collections.TestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, readExternalFormFromBytes, readExternalFormFromDisk, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDisk
 
Methods inherited from class org.apache.commons.collections.BulkTest
clone, ignoredSimpleTests, makeSuite, toString
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestBinaryHeap

public TestBinaryHeap(java.lang.String testName)
Method Detail

suite

public static junit.framework.Test suite()

makeCollection

public java.util.Collection makeCollection()
Return a new, empty Object to used for testing.

Specified by:
makeCollection in class TestCollection

makeConfirmedCollection

public java.util.Collection makeConfirmedCollection()
Description copied from class: TestCollection
Returns a confirmed empty collection. For instance, an ArrayList for lists or a HashSet for sets.

Specified by:
makeConfirmedCollection in class TestCollection
Returns:
a confirmed empty collection

makeConfirmedFullCollection

public java.util.Collection makeConfirmedFullCollection()
Description copied from class: TestCollection
Returns a confirmed full collection. For instance, an ArrayList for lists or a HashSet for sets. The returned collection should contain the elements returned by TestCollection.getFullElements().

Specified by:
makeConfirmedFullCollection in class TestCollection
Returns:
a confirmed full collection

getFullElements

public java.lang.Object[] getFullElements()
Description copied from class: TestCollection
Returns an array of objects that are contained in a collection produced by TestCollection.makeFullCollection(). Every element in the returned array must be an element in a full collection.

The default implementation returns a heterogenous array of objects with some duplicates and with the null element. Override if you require specific testing elements. Note that if you override TestCollection.makeFullCollection(), you must override this method to reflect the contents of a full collection.

Overrides:
getFullElements in class TestCollection

getOtherElements

public java.lang.Object[] getOtherElements()
Description copied from class: TestCollection
Returns an array of elements that are not contained in a full collection. Every element in the returned array must not exist in a collection returned by TestCollection.makeFullCollection(). The default implementation returns a heterogenous array of elements without null. Note that some of the tests add these elements to an empty or full collection, so if your collection restricts certain kinds of elements, you should override this method.

Overrides:
getOtherElements in class TestCollection

testCollectionIteratorFailFast

public void testCollectionIteratorFailFast()
Description copied from class: TestCollection
Tests that the collection's iterator is fail-fast.

Overrides:
testCollectionIteratorFailFast in class TestCollection

testBasicOps

public void testBasicOps()

testBasicComparatorOps

public void testBasicComparatorOps()

verify

public void verify()
Description copied from class: TestCollection
Verifies that TestCollection.collection and TestCollection.confirmed have identical state.

Overrides:
verify in class TestCollection

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.