From eb9884cd916e3e1c9e011e6ae6a3c582264cb258 Mon Sep 17 00:00:00 2001 From: Morgan James Delagrange Date: Mon, 25 Feb 2002 23:26:25 +0000 Subject: [PATCH] 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 --- .../org/apache/commons/collections/TestIterator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/org/apache/commons/collections/TestIterator.java b/src/test/org/apache/commons/collections/TestIterator.java index d8081dd1e..a40fa006f 100644 --- a/src/test/org/apache/commons/collections/TestIterator.java +++ b/src/test/org/apache/commons/collections/TestIterator.java @@ -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 $ - * $Revision: 1.2 $ - * $Date: 2002/02/25 22:48:52 $ + * $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.3 $ + * $Date: 2002/02/25 23:26:25 $ * * ==================================================================== * @@ -85,6 +85,7 @@ public abstract class TestIterator extends TestObject { */ public void testEmptyIterator() { Iterator iter = makeEmptyIterator(); + assertTrue("hasNext() should return false for empty iterators",iter.hasNext() == false); try { iter.next(); fail("NoSuchElementException must be thrown when Iterator is exhausted"); @@ -100,6 +101,9 @@ public abstract class TestIterator extends TestObject { */ public void testFullIterator() { Iterator iter = makeFullIterator(); + + assertTrue("hasNext() should return true for at least one element",iter.hasNext()); + try { iter.next(); } catch (NoSuchElementException e) {