| | |
| | | */ |
| | | public class DITCacheMapTestCase extends APITestCase |
| | | { |
| | | private static final DITCacheMap<String> ditMap = |
| | | new DITCacheMap<String>(); |
| | | private static final DITCacheMap<String> ditMap = new DITCacheMap<>(); |
| | | |
| | | private static final String dn0String = |
| | | "cn=Object0,dc=example,dc=com"; |
| | |
| | | |
| | | private void putAllAndVerify() |
| | | { |
| | | Map<DN,String> hashMap = |
| | | new HashMap<DN,String>(); |
| | | Map<DN,String> hashMap = new HashMap<>(); |
| | | |
| | | hashMap.put(dn0, dn0String); |
| | | hashMap.put(dn1, dn1String); |
| | |
| | | assertFalse(entrySet.isEmpty()); |
| | | assertEquals(entrySet.size(), 10); |
| | | Iterator<Entry<DN,String>> iterator = entrySet.iterator(); |
| | | Map<DN,String> tempMap = new HashMap<DN,String>(); |
| | | Map<DN,String> tempMap = new HashMap<>(); |
| | | while (iterator.hasNext()) |
| | | { |
| | | Entry<DN,String> entry = iterator.next(); |
| | |
| | | |
| | | putAllAndVerify(); |
| | | |
| | | Set<String> removeSet = new HashSet<String>(); |
| | | assertTrue(ditMap.removeSubtree(DN.valueOf( |
| | | "dc=example,dc=com"), |
| | | removeSet)); |
| | | Set<String> removeSet = new HashSet<>(); |
| | | assertTrue(ditMap.removeSubtree(DN.valueOf("dc=example,dc=com"), removeSet)); |
| | | assertFalse(removeSet.isEmpty()); |
| | | assertEquals(removeSet.size(), 10); |
| | | assertTrue(removeSet.contains(dn0String)); |