Keel 2.1RC2

org.apache.commons.collections
Class TestBoundedFifoBuffer

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.TestBoundedFifoBuffer
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test
Direct Known Subclasses:
TestBoundedFifoBuffer2

public class TestBoundedFifoBuffer
extends TestCollection

Test cases for BoundedFifoBuffer.


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
TestBoundedFifoBuffer(java.lang.String n)
           
 
Method Summary
 java.lang.Object[] getFullElements()
          Overridden because BoundedFifoBuffer doesn't support null elements.
 java.util.Collection makeCollection()
          Returns an empty BoundedFifoBuffer that won't overflow.
 java.util.Collection makeConfirmedCollection()
          Returns an empty ArrayList.
 java.util.Collection makeConfirmedFullCollection()
          Returns a full ArrayList.
static junit.framework.Test suite()
           
 void testBoundedFifoBufferRemove()
          Tests that the removal operation actually removes the first element.
 void testCollectionIteratorFailFast()
          Overridden, because BoundedFifoBuffer's iterators aren't fail-fast.
 void testConstructorException1()
          Tests that the constructor correctly throws an exception.
 void testConstructorException2()
          Tests that the constructor correctly throws an exception.
 void verify()
          Runs through the regular verifications, but also verifies that the buffer contains the same elements in the same sequence as the list.
 
Methods inherited from class org.apache.commons.collections.TestCollection
areEqualElementsDistinguishable, getFullNonNullElements, getFullNonNullStringElements, getOtherElements, 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

TestBoundedFifoBuffer

public TestBoundedFifoBuffer(java.lang.String n)
Method Detail

suite

public static junit.framework.Test suite()

makeCollection

public java.util.Collection makeCollection()
Returns an empty BoundedFifoBuffer that won't overflow.

Specified by:
makeCollection in class TestCollection
Returns:
an empty BoundedFifoBuffer

makeConfirmedCollection

public java.util.Collection makeConfirmedCollection()
Returns an empty ArrayList.

Specified by:
makeConfirmedCollection in class TestCollection
Returns:
an empty ArrayList

makeConfirmedFullCollection

public java.util.Collection makeConfirmedFullCollection()
Returns a full ArrayList.

Specified by:
makeConfirmedFullCollection in class TestCollection
Returns:
a full ArrayList

getFullElements

public java.lang.Object[] getFullElements()
Overridden because BoundedFifoBuffer doesn't support null elements.

Overrides:
getFullElements in class TestCollection
Returns:
an array of random objects without a null element

testCollectionIteratorFailFast

public void testCollectionIteratorFailFast()
Overridden, because BoundedFifoBuffer's iterators aren't fail-fast.

Overrides:
testCollectionIteratorFailFast in class TestCollection

verify

public void verify()
Runs through the regular verifications, but also verifies that the buffer contains the same elements in the same sequence as the list.

Overrides:
verify in class TestCollection

testBoundedFifoBufferRemove

public void testBoundedFifoBufferRemove()
Tests that the removal operation actually removes the first element.


testConstructorException1

public void testConstructorException1()
Tests that the constructor correctly throws an exception.


testConstructorException2

public void testConstructorException2()
Tests that the constructor correctly throws an exception.


Keel 2.1RC2

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