Test for null passed to setArray in addition to passing null to the
constructor. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130660 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d6a2418582
commit
94a2ba779b
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestArrayIterator.java,v 1.7 2002/03/19 01:33:12 mas Exp $
|
||||
* $Revision: 1.7 $
|
||||
* $Date: 2002/03/19 01:33:12 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestArrayIterator.java,v 1.8 2002/03/19 01:37:40 mas Exp $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2002/03/19 01:37:40 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
|
@ -73,7 +73,7 @@ import java.util.NoSuchElementException;
|
|||
* @author James Strachan
|
||||
* @author Mauricio S. Moura
|
||||
* @author Morgan Delagrange
|
||||
* @version $Id: TestArrayIterator.java,v 1.7 2002/03/19 01:33:12 mas Exp $
|
||||
* @version $Id: TestArrayIterator.java,v 1.8 2002/03/19 01:37:40 mas Exp $
|
||||
*/
|
||||
public class TestArrayIterator extends TestIterator {
|
||||
|
||||
|
@ -123,7 +123,7 @@ public class TestArrayIterator extends TestIterator {
|
|||
}
|
||||
}
|
||||
|
||||
public void testNullToConstructor() {
|
||||
public void testNullArray() {
|
||||
try {
|
||||
Iterator iter = new ArrayIterator(null);
|
||||
|
||||
|
@ -132,6 +132,15 @@ public class TestArrayIterator extends TestIterator {
|
|||
} catch (NullPointerException e) {
|
||||
// expected
|
||||
}
|
||||
|
||||
ArrayIterator iter = new ArrayIterator();
|
||||
try {
|
||||
iter.setArray(null);
|
||||
|
||||
fail("setArray(null) should throw a NullPointerException");
|
||||
} catch (NullPointerException e) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue