more details for hasNext() testing

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130577 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Morgan James Delagrange 2002-02-25 23:26:25 +00:00
parent 230fb16d83
commit eb9884cd91
1 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/* /*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestIterator.java,v 1.2 2002/02/25 22:48:52 morgand Exp $ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestIterator.java,v 1.3 2002/02/25 23:26:25 morgand Exp $
* $Revision: 1.2 $ * $Revision: 1.3 $
* $Date: 2002/02/25 22:48:52 $ * $Date: 2002/02/25 23:26:25 $
* *
* ==================================================================== * ====================================================================
* *
@ -85,6 +85,7 @@ public abstract class TestIterator extends TestObject {
*/ */
public void testEmptyIterator() { public void testEmptyIterator() {
Iterator iter = makeEmptyIterator(); Iterator iter = makeEmptyIterator();
assertTrue("hasNext() should return false for empty iterators",iter.hasNext() == false);
try { try {
iter.next(); iter.next();
fail("NoSuchElementException must be thrown when Iterator is exhausted"); fail("NoSuchElementException must be thrown when Iterator is exhausted");
@ -100,6 +101,9 @@ public abstract class TestIterator extends TestObject {
*/ */
public void testFullIterator() { public void testFullIterator() {
Iterator iter = makeFullIterator(); Iterator iter = makeFullIterator();
assertTrue("hasNext() should return true for at least one element",iter.hasNext());
try { try {
iter.next(); iter.next();
} catch (NoSuchElementException e) { } catch (NoSuchElementException e) {