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/map AbstractTestMap.java
Date Mon, 07 Jun 2004 23:14:40 GMT
scolebourne    2004/06/07 16:14:40

  Modified:    collections/src/test/org/apache/commons/collections/map
                        AbstractTestMap.java
  Log:
  Fix test cases to avoid dependency on DefaultMapEntry
  
  Revision  Changes    Path
  1.16      +9 -6      jakarta-commons/collections/src/test/org/apache/commons/collections/map/AbstractTestMap.java
  
  Index: AbstractTestMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/map/AbstractTestMap.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AbstractTestMap.java	31 May 2004 22:39:20 -0000	1.15
  +++ AbstractTestMap.java	7 Jun 2004 23:14:40 -0000	1.16
  @@ -27,7 +27,6 @@
   import org.apache.commons.collections.AbstractTestObject;
   import org.apache.commons.collections.BulkTest;
   import org.apache.commons.collections.collection.AbstractTestCollection;
  -import org.apache.commons.collections.keyvalue.DefaultMapEntry;
   import org.apache.commons.collections.set.AbstractTestSet;
   
   /**
  @@ -1068,14 +1067,16 @@
           resetFull();
           Set entrySet = map.entrySet();
           Map.Entry entry = (Map.Entry) entrySet.iterator().next();
  -        Map.Entry test = new DefaultMapEntry(entry);
  +        Map.Entry test = cloneMapEntry(entry);
           assertEquals(true, entrySet.contains(test));
       }
       public void testEntrySetContains3() {
           resetFull();
           Set entrySet = map.entrySet();
           Map.Entry entry = (Map.Entry) entrySet.iterator().next();
  -        Map.Entry test = new DefaultMapEntry(entry.getKey(), "A VERY DIFFERENT VALUE");
  +        HashMap temp = new HashMap();
  +        temp.put(entry.getKey(), "A VERY DIFFERENT VALUE");
  +        Map.Entry test = (Map.Entry) temp.entrySet().iterator().next();
           assertEquals(false, entrySet.contains(test));
       }
       
  @@ -1098,7 +1099,7 @@
           Set entrySet = map.entrySet();
           Map.Entry entry = (Map.Entry) entrySet.iterator().next();
           Object key = entry.getKey();
  -        Map.Entry test = new DefaultMapEntry(entry);
  +        Map.Entry test = cloneMapEntry(entry);
           
           assertEquals(true, entrySet.remove(test));
           assertEquals(false, map.containsKey(key));
  @@ -1111,7 +1112,9 @@
           Set entrySet = map.entrySet();
           Map.Entry entry = (Map.Entry) entrySet.iterator().next();
           Object key = entry.getKey();
  -        Map.Entry test = new DefaultMapEntry(entry.getKey(), "A VERY DIFFERENT VALUE");
  +        HashMap temp = new HashMap();
  +        temp.put(entry.getKey(), "A VERY DIFFERENT VALUE");
  +        Map.Entry test = (Map.Entry) temp.entrySet().iterator().next();
           
           assertEquals(false, entrySet.remove(test));
           assertEquals(true, map.containsKey(key));
  
  
  

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