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 AbstractTestBidiMap.java
Date Fri, 31 Oct 2003 01:25:24 GMT
scolebourne    2003/10/30 17:25:24

  Modified:    collections/src/test/org/apache/commons/collections
                        AbstractTestBidiMap.java
  Log:
  Ensure that values returned are in same order as keys
  
  Revision  Changes    Path
  1.3       +17 -2     jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestBidiMap.java
  
  Index: AbstractTestBidiMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestBidiMap.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractTestBidiMap.java	29 Oct 2003 00:06:25 -0000	1.2
  +++ AbstractTestBidiMap.java	31 Oct 2003 01:25:24 -0000	1.3
  @@ -58,6 +58,7 @@
   package org.apache.commons.collections;
   
   import java.util.HashMap;
  +import java.util.Iterator;
   import java.util.Map;
   import java.util.NoSuchElementException;
   
  @@ -287,6 +288,20 @@
           final Object key = map.removeKey(value);
           assertTrue("Key was not removed.", !map.containsKey(key));
           assertNull("Value was not removed.", map.getKey(value));
  +    }
  +
  +    //-----------------------------------------------------------------------
  +    public void testBidiKeySetValuesOrder() {
  +        resetFull();
  +        Iterator keys = map.keySet().iterator();
  +        Iterator values = map.values().iterator();
  +        for (; keys.hasNext() && values.hasNext();) {
  +            Object key = keys.next();
  +            Object value = values.next();
  +            assertSame(map.get(key), value);
  +        }
  +        assertEquals(false, keys.hasNext());
  +        assertEquals(false, values.hasNext());
       }
   
       //-----------------------------------------------------------------------
  
  
  

---------------------------------------------------------------------
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