Package org.infinispan.persistence.spi

Examples of org.infinispan.persistence.spi.CacheLoader.load()


      for (Cache<Object, String> c : caches) {
         assertEquals(value2, c.get(key));
         if (isOwner(c, key)) {
            CacheLoader store = TestingUtil.getFirstLoader(c);
            assertTrue(store.contains(key));
            assertEquals(value2, store.load(key).getValue());
         }
      }
   }
  
   public void testAtomicReplaceFromNonOwnerWithFlag() throws Exception {
View Full Code Here


      for (Cache<Object, String> c : caches) {
         assertEquals(value2, c.get(key));
         if (isOwner(c, key)) {
            CacheLoader store = TestingUtil.getFirstLoader(c);
            assertTrue(store.contains(key));
            assertEquals(value, store.load(key).getValue());
         }
      }
   }

   public void testAtomicPutIfAbsentFromNonOwner(Method m) throws Exception {
View Full Code Here

      for (Cache<Object, String> c : caches) {
         assertEquals(replaced, c.get(key));
         if (isOwner(c, key)) {
            CacheLoader store = TestingUtil.getFirstLoader(c);
            assertTrue(store.contains(key));
            assertEquals(value, store.load(key).getValue());
         }
      }
   }
  
   public void testAtomicPutIfAbsentFromNonOwnerWithFlag(Method m) throws Exception {
View Full Code Here

      cache = cacheManager.getCache();
      cache.put("a", "b");
      assert cache.get("a").equals("b");
      CacheLoader cl = TestingUtil.getCacheLoader(cache);
      assert cl != null;
      MarshalledEntry se = cl.load("a");
      assert se != null;
      assert se.getValue().equals("b");

      // clear the cache
      cache.getAdvancedCache().withFlags(SKIP_CACHE_STORE).clear();
View Full Code Here

      assert se.getValue().equals("b");

      // clear the cache
      cache.getAdvancedCache().withFlags(SKIP_CACHE_STORE).clear();

      se = cl.load("a");
      assert se != null;
      assert se.getValue().equals("b");

      // now attempt a concurrent get and evict.
      ExecutorService e = Executors.newFixedThreadPool(1);
View Full Code Here

      for (int i = 0; i < INSERTION_COUNT; ++i) {
         assertTrue("Didn't contain key " + i, l.contains("key " + i));
      }

      for (int i = 0; i < INSERTION_COUNT; ++i) {
         assertEquals("value " + i, l.load("key " + i).getValue());
      }
   }
}
View Full Code Here

   public void testPutFromNonOwner() throws Exception {
      Cache<Object, String> cacheX = getFirstNonOwner("key1");
      CacheLoader storeX = TestingUtil.getFirstLoader(cacheX);
      cacheX.put("key1", "v1");
      assertEquals("v1", cacheX.get("key1"));
      assertNotNull(storeX.load("key1"));
      assertEquals("v1", storeX.load("key1").getValue());
   }

}
View Full Code Here

      Cache<Object, String> cacheX = getFirstNonOwner("key1");
      CacheLoader storeX = TestingUtil.getFirstLoader(cacheX);
      cacheX.put("key1", "v1");
      assertEquals("v1", cacheX.get("key1"));
      assertNotNull(storeX.load("key1"));
      assertEquals("v1", storeX.load("key1").getValue());
   }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.