/[Apache-SVN]/jakarta/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/AbstractTestMap.java
ViewVC logotype

Diff of /jakarta/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/AbstractTestMap.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- jakarta/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/AbstractTestMap.java	2005/05/07 16:45:39	169096
+++ jakarta/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/AbstractTestMap.java	2005/05/07 17:13:40	169097
@@ -907,23 +907,46 @@ public abstract class AbstractTestMap ex
             return;
         }
 
+        // check putAll OK adding empty map to empty map
         resetEmpty();
+        assertEquals(0, map.size());
+        map.putAll(new HashMap());
+        assertEquals(0, map.size());
+
+        // check putAll OK adding empty map to non-empty map
+        resetFull();
+        int size = map.size();
+        map.putAll(new HashMap());
+        assertEquals(size, map.size());
 
+        // check putAll OK adding non-empty map to empty map
+        resetEmpty();
         Map m2 = makeFullMap();
-
         map.putAll(m2);
         confirmed.putAll(m2);
         verify();
 
+        // check putAll OK adding non-empty JDK map to empty map
         resetEmpty();
-
         m2 = makeConfirmedMap();
         Object[] keys = getSampleKeys();
         Object[] values = getSampleValues();
         for(int i = 0; i < keys.length; i++) {
             m2.put(keys[i], values[i]);
         }
+        map.putAll(m2);
+        confirmed.putAll(m2);
+        verify();
 
+        // check putAll OK adding non-empty JDK map to non-empty map
+        resetEmpty();
+        m2 = makeConfirmedMap();
+        map.put(keys[0], values[0]);
+        confirmed.put(keys[0], values[0]);
+        verify();
+        for(int i = 1; i < keys.length; i++) {
+            m2.put(keys[i], values[i]);
+        }
         map.putAll(m2);
         confirmed.putAll(m2);
         verify();

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26