255256257258259260261262263264265
} public void testEntrySet() { Cache cache = initialize(); Set set = cache.entrySet(); assertEquals(3, set.size()); Object[] objs = set.toArray(); HashMap map = new HashMap();
798081828384858687
assertEquals(0, keys.size()); Collection values = cache.values(); assertEquals(0, values.size()); Set entries = cache.entrySet(); assertEquals(0, entries.size()); } }
237238239240241242243244245246247
} public void testEntrySet() throws CacheAcquireException { Cache cache = initialize(); Set set = cache.entrySet(); assertEquals(3, set.size()); Object[] objs = set.toArray(); HashMap map = new HashMap();
121122123124125126127128129130131
} catch (Throwable t) { fail("UnsupportedOperationException should have been thrown."); } try { c.entrySet(); fail("UnsupportedOperationException should have been thrown."); } catch (UnsupportedOperationException ex) { assertEquals("entrySet()", ex.getMessage()); } catch (Throwable t) { fail("UnsupportedOperationException should have been thrown.");
211212213214215216217218219220221
161162163164165166167168169170171
} catch (UnsupportedOperationException ex) { assertEquals("values()", ex.getMessage()); } try { c.entrySet(); fail("entrySet() should throw an UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { assertEquals("entrySet()", ex.getMessage()); } }