@Override protected HttpResponse removeResponseImpl(String key) { return cache.removeElement(key); } }
@Override protected HttpResponse removeResponseImpl(String key) { return cache.removeElement(key); } }
@Override protected void removeResponseImpl(String key) { cache.removeElement(key); } }
@Test public void getNamedCache() throws Exception { Cache<String, String> cache = defaultProvider.createCache("testcache"); Cache<String, String> cache2 = defaultProvider.createCache("testcache"); Assert.assertNotNull(cache); Assert.assertEquals(cache, cache2); Assert.assertNull(cache.getElement("test")); cache.addElement("test", "value1"); Assert.assertEquals("value1", cache.getElement("test")); cache.removeElement("test"); Assert.assertNull(cache.getElement("test")); Assert.assertEquals(cache.getCapacity(), cache2.getCapacity()); Assert.assertEquals(cache.getSize(), cache2.getSize()); } }
@Test public void getNamedCache() throws Exception { Cache<String, String> cache = defaultProvider.createCache("testcache"); Cache<String, String> cache2 = defaultProvider.createCache("testcache"); Assert.assertNotNull(cache); Assert.assertEquals(cache, cache2); Assert.assertNull(cache.getElement("test")); cache.addElement("test", "value1"); Assert.assertEquals("value1", cache.getElement("test")); cache.removeElement("test"); Assert.assertNull(cache.getElement("test")); Assert.assertEquals(cache.getCapacity(), cache2.getCapacity()); Assert.assertEquals(cache.getSize(), cache2.getSize()); } }
@Test public void getNamedCache() throws Exception { Cache<String, String> cache = defaultProvider.createCache("testcache"); Cache<String, String> cache2 = defaultProvider.createCache("testcache"); Assert.assertNotNull(cache); Assert.assertEquals(cache, cache2); Assert.assertNull(cache.getElement("test")); cache.addElement("test", "value1"); Assert.assertEquals("value1", cache.getElement("test")); cache.removeElement("test"); Assert.assertNull(cache.getElement("test")); Assert.assertEquals(cache.getCapacity(), cache2.getCapacity()); Assert.assertEquals(cache.getSize(), cache2.getSize()); }
@Test public void getNamedCache() throws Exception { Cache<String, String> cache = defaultProvider.createCache("testcache"); Cache<String, String> cache2 = defaultProvider.createCache("testcache"); Assert.assertNotNull(cache); Assert.assertEquals(cache, cache2); Assert.assertNull(cache.getElement("test")); cache.addElement("test", "value1"); Assert.assertEquals("value1", cache.getElement("test")); cache.removeElement("test"); Assert.assertNull(cache.getElement("test")); Assert.assertEquals(cache.getCapacity(), cache2.getCapacity()); Assert.assertEquals(cache.getSize(), cache2.getSize()); }
@Test public void getNamedCache() throws Exception { Cache<String, String> cache = defaultProvider.createCache("testcache"); Cache<String, String> cache2 = defaultProvider.createCache("testcache"); Assert.assertNotNull(cache); Assert.assertEquals(cache, cache2); Assert.assertNull(cache.getElement("test")); cache.addElement("test", "value1"); Assert.assertEquals("value1", cache.getElement("test")); cache.removeElement("test"); Assert.assertNull(cache.getElement("test")); Assert.assertEquals(cache.getCapacity(), cache2.getCapacity()); Assert.assertEquals(cache.getSize(), cache2.getSize()); }