/** * Confirm that putAll(Map) does not cause the LRUMap * to exceed its maxiumum size. */ @Test public void testPutAll() { LRUMap<Integer, String> map2 = new LRUMap<Integer, String>(3); map2.put(1,"foo"); map2.put(2,"foo"); map2.put(3,"foo"); HashMap<Integer, String> hashMap = new HashMap<Integer, String>(); hashMap.put(4,"foo"); map2.putAll(hashMap); assertTrue("max size is 3, but actual size is " + map2.size(), map2.size() == 3); assertTrue("map should contain the Integer(4) object", map2.containsKey(new Integer(4))); }
/** * Confirm that putAll(Map) does not cause the LRUMap * to exceed its maxiumum size. */ public void testPutAll() { LRUMap map2 = new LRUMap(3); map2.put(new Integer(1),"foo"); map2.put(new Integer(2),"foo"); map2.put(new Integer(3),"foo"); HashMap hashMap = new HashMap(); hashMap.put(new Integer(4),"foo"); map2.putAll(hashMap); assertTrue("max size is 3, but actual size is " + map2.size(), map2.size() == 3); assertTrue("map should contain the Integer(4) object", map2.containsKey(new Integer(4))); }
/** * Confirm that putAll(Map) does not cause the LRUMap * to exceed its maxiumum size. */ public void testPutAll() { LRUMap<Integer, String> map2 = new LRUMap<Integer, String>(3); map2.put(1,"foo"); map2.put(2,"foo"); map2.put(3,"foo"); HashMap<Integer, String> hashMap = new HashMap<Integer, String>(); hashMap.put(4,"foo"); map2.putAll(hashMap); assertTrue("max size is 3, but actual size is " + map2.size(), map2.size() == 3); assertTrue("map should contain the Integer(4) object", map2.containsKey(new Integer(4))); }
/** * Confirm that putAll(Map) does not cause the LRUMap * to exceed its maxiumum size. */ @Test public void testPutAll() { LRUMap<Integer, String> map2 = new LRUMap<Integer, String>(3); map2.put(1,"foo"); map2.put(2,"foo"); map2.put(3,"foo"); HashMap<Integer, String> hashMap = new HashMap<Integer, String>(); hashMap.put(4,"foo"); map2.putAll(hashMap); assertTrue("max size is 3, but actual size is " + map2.size(), map2.size() == 3); assertTrue("map should contain the Integer(4) object", map2.containsKey(new Integer(4))); }