Package org.infinispan.test.fwk

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()


         @Override
         public Object answer(InvocationOnMock invocation) throws Throwable {
            Object[] arguments = invocation.getArguments();
            CacheTopology topology = (CacheTopology) arguments[0];
            checkpoint.trigger("pre_ch_update_" + topology.getTopologyId());
            checkpoint.awaitStrict("pre_ch_update_" + topology.getTopologyId(), 10, SECONDS);
            return invocation.callRealMethod();
         }
      }).when(spyProvider).onTopologyUpdate(any(CacheTopology.class), eq(false));

      // Block prepare commands on cache 0
View Full Code Here


      int initialTopologyId = stm0.getCacheTopology().getTopologyId();

      // Start cache 1, but the state request will be blocked on cache 0
      int rebalanceTopologyId = initialTopologyId + 1;
      AdvancedCache<Object, Object> cache1 = advancedCache(1, CACHE_NAME);
      checkpoint.awaitStrict("pre_get_transactions_" + rebalanceTopologyId + "_from_" + address(1), 10, SECONDS);

      // Start a transaction on cache 0, which will block just before the distribution interceptor
      Future<Object> future = fork(new Callable<Object>() {
         @Override
         public Object call() throws Exception {
View Full Code Here

            return null;
         }
      });

      // Make sure the thread is waiting for the response
      checkPoint.awaitStrict("pre_send_response_invoked", 10, TimeUnit.SECONDS);

      // Now kill the cache - we should recover
      killMember(1, CACHE_NAME);

      checkPoint.trigger("pre_send_response_released");
View Full Code Here

            return null;
         }
      });

      // Now wait for them to send back first results
      checkPoint.awaitStrict("post_send_response_invoked", 10, TimeUnit.SECONDS);

      // We should get a value now, note all values are currently residing on cache1 as primary
      Map.Entry<Object, String> value = returnQueue.poll(10, TimeUnit.SECONDS);

      // Now kill the cache - we should recover
View Full Code Here

            return null;
         }
      });

      // Now wait for them to send back first results but don't let them process
      checkPoint.awaitStrict("pre_receive_response_invoked", 10, TimeUnit.SECONDS);

      // Now let them process the results
      checkPoint.triggerForever("pre_receive_response_released");

      // Now kill the cache - we should recover and get appropriate values
View Full Code Here

            return null;
         }
      });

      // Now wait for them to send back first results but don't let them process
      checkPoint.awaitStrict("pre_iterator_invoked", 10, TimeUnit.SECONDS);

      // Now kill the cache - we should recover and get appropriate values
      killMember(1, CACHE_NAME);

      // Now let them process the results
View Full Code Here

      log.warn("Doing get here - ignore all previous");

      Future<String> getFuture = nonOwnerCache.getAsync(key);

      // Wait until we are about to write value into data container on non owner
      checkPoint.awaitStrict("pre_acquire_shared_topology_lock_invoked", 10, TimeUnit.SECONDS);

      Future<String> putFuture = ownerCache.putAsync(key, secondValue);

      try {
         putFuture.get(1, TimeUnit.SECONDS);
View Full Code Here

         log.warn("Doing get here - ignore all previous");

         Future<String> getFuture = nonOwnerCache.getAsync(key);

         // Wait until we are about to write value into data container on non owner
         checkPoint.awaitStrict("pre_acquire_shared_topology_lock_invoked", 10, TimeUnit.SECONDS);

         Future<String> getFuture2 = nonOwnerCache.getAsync(key);

         try {
            getFuture2.get(1, TimeUnit.SECONDS);
View Full Code Here

         public String call() throws Exception {
            return cache0.put(key, FIRST_VALUE);
         }
      });

      checkPoint.awaitStrict("post_raise_notification_invoked", 10, TimeUnit.SECONDS);

      // Kill the cache now - note this will automatically unblock the fork thread
      TestingUtil.killCacheManagers(cache1.getCacheManager());

      future.get(10, TimeUnit.SECONDS);
View Full Code Here

         log.warn("Doing get here - ignore all previous");

         Future<String> getFuture = nonOwnerCache.getAsync(key);

         // Wait until we are about to write value into data container on non owner
         checkPoint.awaitStrict("pre_acquire_shared_topology_lock_invoked", 10, TimeUnit.SECONDS);

         Future<String> getFuture2 = nonOwnerCache.getAsync(key);

         try {
            getFuture2.get(1, TimeUnit.SECONDS);
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.