rwaldhoff 2003/10/09 03:33:45
Modified: collections/src/test/org/apache/commons/collections/iterators
AbstractTestListIterator.java
Log:
extract methods testRemoveThenSet and testAddThenSet, so we don't assume the full
iterator contains more than one element
Revision Changes Path
1.2 +12 -6
jakarta-commons/collections/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java
Index: AbstractTestListIterator.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractTestListIterator.java 1 Oct 2003 21:54:54 -0000 1.1
+++ AbstractTestListIterator.java 9 Oct 2003 10:33:45 -0000 1.2
@@ -268,8 +268,11 @@
// repeated set calls should be fine
it.set(addSetValue());
- // remove then set
- if (supportsRemove()) {
+ }
+
+ public void testRemoveThenSet() {
+ ListIterator it = makeFullListIterator();
+ if (supportsRemove() && supportsSet()) {
it.next();
it.remove();
try {
@@ -278,9 +281,12 @@
} catch (IllegalStateException e) {
}
}
-
+ }
+
+ public void testAddThenSet() {
+ ListIterator it = makeFullListIterator();
// add then set
- if (supportsAdd()) {
+ if (supportsAdd() && supportsSet()) {
it.next();
it.add(addSetValue());
try {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]