Package org.infinispan.loaders

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


   public void testPutFromNonOwner() throws Exception {
      String key = "k4", value = "value4";
      for (Cache<Object, String> c : caches) assert c.isEmpty();
      Cache<Object, String> nonOwner = getFirstNonOwner(key);
      CacheStore nonOwnerStore = TestingUtil.extractComponent(nonOwner, CacheLoaderManager.class).getCacheStore();
      assert !nonOwnerStore.containsKey(key);
      Object retval = nonOwner.put(key, value);
      asyncWait(key, PutKeyValueCommand.class, getSecondNonOwner(key));

      Cache[] owners = getOwners(key);
      CacheStore store = TestingUtil.extractComponent(owners[0], CacheLoaderManager.class).getCacheStore();
View Full Code Here


      asyncWait(key, PutKeyValueCommand.class, getSecondNonOwner(key));

      Cache[] owners = getOwners(key);
      CacheStore store = TestingUtil.extractComponent(owners[0], CacheLoaderManager.class).getCacheStore();
      assertIsInContainerImmortal(owners[0], key);
      assert store.containsKey(key);

      for (int i = 1; i < owners.length; i++) {
         store = TestingUtil.extractComponent(owners[i], CacheLoaderManager.class).getCacheStore();
         assertIsInContainerImmortal(owners[i], key);
         assert store.containsKey(key);
View Full Code Here

      assert store.containsKey(key);

      for (int i = 1; i < owners.length; i++) {
         store = TestingUtil.extractComponent(owners[i], CacheLoaderManager.class).getCacheStore();
         assertIsInContainerImmortal(owners[i], key);
         assert store.containsKey(key);
      }

      for (Cache<Object, String> c : caches) {
         store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         assert store.containsKey(key);
View Full Code Here

         assert store.containsKey(key);
      }

      for (Cache<Object, String> c : caches) {
         store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         assert store.containsKey(key);
         assertNumberOfInvocations(store, "store", 1);
      }

      if (testRetVals) assert retval == null;
      assertOnAllCachesAndOwnership(key, value);
View Full Code Here

      Cache[] owners = getOwners(key);
      Object retval = owners[0].put(key, value);
      asyncWait(key, PutKeyValueCommand.class, getNonOwners(key));
      CacheStore store = TestingUtil.extractComponent(owners[0], CacheLoaderManager.class).getCacheStore();
      assertIsInContainerImmortal(owners[0], key);
      assert store.containsKey(key);

      for (int i = 1; i < owners.length; i++) {
         store = TestingUtil.extractComponent(owners[i], CacheLoaderManager.class).getCacheStore();
         assertIsInContainerImmortal(owners[i], key);
         assert store.containsKey(key);
View Full Code Here

      assert store.containsKey(key);

      for (int i = 1; i < owners.length; i++) {
         store = TestingUtil.extractComponent(owners[i], CacheLoaderManager.class).getCacheStore();
         assertIsInContainerImmortal(owners[i], key);
         assert store.containsKey(key);
      }

      for (Cache<Object, String> c : caches) {
         store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         if (isOwner(c, key)) {
View Full Code Here

      for (Cache<Object, String> c : caches) {
         store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         if (isOwner(c, key)) {
            assertIsInContainerImmortal(c, key);
         }
         assert store.containsKey(key);
         assertNumberOfInvocations(store, "store", 1);
      }

      if (testRetVals) assert retval == null;
      assertOnAllCachesAndOwnership(key, value);
View Full Code Here

            if (isFirstOwner(c, key)) {
               assertIsInContainerImmortal(c, key);
            }
            log.debug("Testing " + c);
            assertNumberOfInvocations(store, "store", 4);
            assert store.containsKey(key);
         }
      }
   }

   public void testRemoveFromNonOwner() throws Exception {
View Full Code Here

      Object retval = getFirstNonOwner(key).remove(key);
      asyncWait("k1", RemoveCommand.class, getSecondNonOwner("k1"));
      if (testRetVals) assert value.equals(retval);
      for (Cache<Object, String> c : caches) {
         CacheStore store = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         assert !store.containsKey(key);
         assertNumberOfInvocations(store, "remove", 1);
      }
   }

   public void testReplaceFromNonOwner() throws Exception {
View Full Code Here

       * the cache store is shared, each cache has each own cache store, that allows for checking
       * who execute puts, removes...etc. */
      CacheStore store = TestingUtil.extractComponent(c1, CacheLoaderManager.class).getCacheStore();
      for (int i = 0; i < 5; i++) {
         String key = "k" + i;
         assert !store.containsKey(key);
         assertNumberOfInvocations(store, "clear", 1);
      }
   }
}
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.