Package org.infinispan.loaders

Examples of org.infinispan.loaders.CacheStore.load()


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


      Cache<Object, String> cacheX = getFirstNonOwner("key1");
      CacheStore storeX = TestingUtil.extractComponent(
            cacheX, CacheLoaderManager.class).getCacheStore();
      cacheX.put("key1", "v1");
      assertEquals("v1", cacheX.get("key1"));
      assertNotNull(storeX.load("key1"));
      assertEquals("v1", storeX.load("key1").getValue());
   }

}
View Full Code Here

      CacheStore storeX = TestingUtil.extractComponent(
            cacheX, CacheLoaderManager.class).getCacheStore();
      cacheX.put("key1", "v1");
      assertEquals("v1", cacheX.get("key1"));
      assertNotNull(storeX.load("key1"));
      assertEquals("v1", storeX.load("key1").getValue());
   }

}
View Full Code Here

public class ReadOnlyCacheStoreTest extends AbstractInfinispanTest {
   public void testWriteMethods() throws CacheLoaderException {
      CacheStore mock = mock(CacheStore.class);
      ReadOnlyStore store = new ReadOnlyStore(mock);
      InternalCacheEntry mockEntry = mock(InternalCacheEntry.class);
      when(mock.load("key")).thenReturn(mockEntry);

      // these should be "silent" no-ops and not actually change anything.
      store.clear();
      store.purgeExpired();
      store.remove("key");
View Full Code Here

      for (Cache<Object, String> c : caches) {
         CacheStore store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         if (isOwner(c, key)) {
            assertIsInContainerImmortal(c, key);
            assert store.load(key).getValue().equals(value);
         } else {
            assert !store.containsKey(key);
         }
      }
View Full Code Here

      for (Cache<Object, String> c : caches) {
         CacheStore store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         if (isOwner(c, key)) {
            assertIsInContainerImmortal(c, key);
            assert store.load(key).getValue().equals(value);
         } else {
            assert !store.containsKey(key);
         }
      }
View Full Code Here

      for (Cache<Object, String> c : caches) {
         CacheStore store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         if (isOwner(c, key)) {
            assertIsInContainerImmortal(c, key);
            assert c.get(key).equals(value2);
            assert store.load(key).getValue().equals(value2);
         } else {
            assert !store.containsKey(key);
         }
      }
   }
View Full Code Here

      for (Cache<Object, String> c : caches) {
         CacheStore store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         if (isOwner(c, key)) {
            assertIsInContainerImmortal(c, key);
            assert c.get(key).equals(value2);
            assert store.load(key).getValue().equals(value);
         } else {
            assert !store.containsKey(key);
         }
      }
   }
View Full Code Here

      for (Cache<Object, String> c : caches) {
         assertEquals(value2, c.get(key));
         if (isOwner(c, key)) {
            CacheStore store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
            assertTrue(store.containsKey(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)) {
            CacheStore store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
            assertTrue(store.containsKey(key));
            assertEquals(value, store.load(key).getValue());
         }
      }
   }

   public void testAtomicPutIfAbsentFromNonOwner(Method m) throws Exception {
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.