Package org.apache.shindig.common.cache

Examples of org.apache.shindig.common.cache.CacheProvider


*/
public class EhCacheCacheProviderTest {

  @Test
  public void getAnonCache() throws Exception {
    CacheProvider defaultProvider = new EhCacheCacheProvider(
        "res://org/apache/shindig/common/cache/ehcache/ehcacheConfig.xml", true, true);
    Cache<String, String> cache = defaultProvider.createCache(null);
    Assert.assertNotNull(cache);
    Assert.assertNull(cache.getElement("test"));
    cache.addElement("test", "value1");
    Assert.assertEquals(cache.getElement("test"), "value1");
    cache.removeElement("test");
View Full Code Here


  }

  @Test
  public void getNamedCache() throws Exception {
    CacheProvider defaultProvider = new EhCacheCacheProvider(
        "res://org/apache/shindig/common/cache/ehcache/ehcacheConfig.xml", true, true);
    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(cache.getElement("test"), "value1");
View Full Code Here

TOP

Related Classes of org.apache.shindig.common.cache.CacheProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.