Author: sebb Date: Mon Jun 24 19:16:42 2013 New Revision: 1496168 URL: http://svn.apache.org/r1496168 Log: Add tests for COLLECTIONS-474 - with null values and with non-null values
Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java?rev=1496168&r1=1496167&r2=1496168&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java Mon Jun 24 19:16:42 2013 @@ -385,6 +385,34 @@ public class ListOrderedMapTest<K, V> ex } } + public void testCOLLECTIONS_474_nullValues () { + Object key1 = new Object(); + Object key2 = new Object(); + HashMap<Object, Object> hmap = new HashMap<Object, Object>(); + hmap.put(key1, null); + hmap.put(key2, null); + assertEquals("Should have two elements", 2, hmap.size()); + ListOrderedMap<Object, Object> listMap = new ListOrderedMap<Object, Object>(); + listMap.put(key1, null); + listMap.put(key2, null); + assertEquals("Should have two elements", 2, listMap.size()); + listMap.putAll(2, hmap); + } + + public void testCOLLECTIONS_474_nonNullValues () { + Object key1 = new Object(); + Object key2 = new Object(); + HashMap<Object, Object> hmap = new HashMap<Object, Object>(); + hmap.put(key1, "1"); + hmap.put(key2, "2"); + assertEquals("Should have two elements", 2, hmap.size()); + ListOrderedMap<Object, Object> listMap = new ListOrderedMap<Object, Object>(); + listMap.put(key1, "3"); + listMap.put(key2, "4"); + assertEquals("Should have two elements", 2, listMap.size()); + listMap.putAll(2, hmap); + } + //----------------------------------------------------------------------- public BulkTest bulkTestKeyListView() { return new TestKeyListView();