commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections TestList.java
Date Sat, 26 Apr 2003 10:27:59 GMT
scolebourne    2003/04/26 03:27:59

  Modified:    collections/src/test/org/apache/commons/collections
                        TestList.java
  Log:
  Fix bug in test for sub list ignoring set boolean
  Updated test for better error messages
  from Neil O'Toole
  
  Revision  Changes    Path
  1.17      +14 -12    jakarta-commons/collections/src/test/org/apache/commons/collections/TestList.java
  
  Index: TestList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestList.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TestList.java	26 Feb 2003 01:33:22 -0000	1.16
  +++ TestList.java	26 Apr 2003 10:27:59 -0000	1.17
  @@ -87,6 +87,7 @@
    * @author Rodney Waldhoff
    * @author Paul Jack
    * @author Stephen Colebourne
  + * @author Neil O'Toole
    */
   public abstract class TestList extends TestCollection {
   
  @@ -804,21 +805,19 @@
           List list = getList();
   
           while (i > 0) {
  -            assertTrue("Iterator should have next", iter.hasPrevious());
  -            assertEquals("Iterator.nextIndex should work", 
  -              iter.nextIndex(), i);
  -            assertEquals("Iterator.previousIndex should work",
  -              iter.previousIndex(), i - 1);
  +            assertTrue("Iterator should have previous, i:" + i, iter.hasPrevious());
  +            assertEquals("Iterator.nextIndex should work, i:" + i, iter.nextIndex(), i);
  +            assertEquals("Iterator.previousIndex should work, i:" + i, iter.previousIndex(),
i - 1);
               Object o = iter.previous();
  -            assertEquals("Iterator returned correct element", 
  -              list.get(i - 1), o);
  +            assertEquals("Iterator returned correct element", list.get(i - 1), o);
               i--;
           }
   
           assertTrue("Iterator shouldn't have previous", !iter.hasPrevious());
  -        assertEquals("nextIndex should be 0", iter.nextIndex(), 0);
  -        assertEquals("previousIndex should be -1", 
  -          iter.previousIndex(), -1);
  +        int nextIndex = iter.nextIndex();
  +        assertEquals("nextIndex should be 0, actual value: " + nextIndex, nextIndex, 0);
  +        int prevIndex = iter.previousIndex();
  +        assertEquals("previousIndex should be -1, actual value: " + prevIndex, prevIndex,
-1);
   
           try {
               iter.previous();
  @@ -1049,6 +1048,9 @@
              return outer.isAddSupported();
          }
   
  +       protected boolean isSetSupported() {
  +           return outer.isSetSupported();
  +       }
   
          protected boolean isRemoveSupported() {
              return outer.isRemoveSupported();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message