Keel 2.1RC2

org.apache.commons.collections.iterators
Class TestIterator

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.iterators.TestIterator
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test
Direct Known Subclasses:
TestArrayIterator, TestArrayIterator2, TestCollatingIterator, TestFilterIterator, TestIteratorChain, TestListIteratorWrapper, TestSingletonIterator, TestSingletonListIterator, TestUniqueFilterIterator

public abstract class TestIterator
extends TestObject

Base class for tetsing Iterator interface

Author:
Morgan Delagrange

Field Summary
 
Fields inherited from class org.apache.commons.collections.TestObject
COLLECTIONS_MAJOR_VERSION
 
Fields inherited from class org.apache.commons.collections.BulkTest
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestIterator(java.lang.String testName)
           
 
Method Summary
abstract  java.util.Iterator makeEmptyIterator()
           
abstract  java.util.Iterator makeFullIterator()
           
 boolean supportsEmptyIterator()
          Whether or not we are testing an iterator that can be empty.
 boolean supportsFullIterator()
          Whether or not we are testing an iterator that can contain elements.
 void testEmptyIterator()
          Should throw a NoSuchElementException.
 void testFullIterator()
          NoSuchElementException (or any other exception) should not be thrown for the first element.
 
Methods inherited from class org.apache.commons.collections.TestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, makeObject, 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

TestIterator

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

makeEmptyIterator

public abstract java.util.Iterator makeEmptyIterator()

makeFullIterator

public abstract java.util.Iterator makeFullIterator()

supportsEmptyIterator

public boolean supportsEmptyIterator()
Whether or not we are testing an iterator that can be empty. Default is true.

Returns:
true if Iterators can be empty

supportsFullIterator

public boolean supportsFullIterator()
Whether or not we are testing an iterator that can contain elements. Default is true.

Returns:
true if Iterators can be empty

testEmptyIterator

public void testEmptyIterator()
Should throw a NoSuchElementException.


testFullIterator

public void testFullIterator()
NoSuchElementException (or any other exception) should not be thrown for the first element. NoSuchElementException must be thrown when hasNext() returns false


Keel 2.1RC2

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