Keel 2.1RC2

org.apache.commons.collections
Class TestUnboundedFifoBuffer

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.TestUnboundedFifoBuffer
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test

public class TestUnboundedFifoBuffer
extends TestCollection

Test cases for UnboundedFifoBuffer.


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
TestUnboundedFifoBuffer(java.lang.String n)
           
 
Method Summary
 java.lang.Object[] getFullElements()
          Overridden because UnboundedFifoBuffer doesn't allow null elements.
 java.util.Collection makeCollection()
          Returns an empty UnboundedFifoBuffer with a small capacity.
 java.util.Collection makeConfirmedCollection()
          Returns an empty ArrayList.
 java.util.Collection makeConfirmedFullCollection()
          Returns a full ArrayList.
static junit.framework.Test suite()
           
 void testCollectionIteratorFailFast()
          Overridden because UnboundedFifoBuffer'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 testUnboundedFifoBufferRemove()
          Tests that UnboundedFifoBuffer removes elements in the right order.
 void verify()
          Verifies that the ArrayList has the same elements in the same sequence as the UnboundedFifoBuffer.
 
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

TestUnboundedFifoBuffer

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

suite

public static junit.framework.Test suite()

makeCollection

public java.util.Collection makeCollection()
Returns an empty UnboundedFifoBuffer with a small capacity.

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

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 UnboundedFifoBuffer doesn't allow null elements.

Overrides:
getFullElements in class TestCollection
Returns:
an array of random elements without the null element

testCollectionIteratorFailFast

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

Overrides:
testCollectionIteratorFailFast in class TestCollection

verify

public void verify()
Verifies that the ArrayList has the same elements in the same sequence as the UnboundedFifoBuffer.

Overrides:
verify in class TestCollection

testUnboundedFifoBufferRemove

public void testUnboundedFifoBufferRemove()
Tests that UnboundedFifoBuffer removes elements in the right order.


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.