Package org.infinispan.test.fwk

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


      cache0.removeInterceptor(BlockingInterceptor.class);

      // Allow the rebalance to end
      int postJoinTopologyId = duringJoinTopologyId + 1;
      checkPoint.trigger("allow_topology_" + postJoinTopologyId + "_on_" + address(0));
      checkPoint.trigger("allow_topology_" + postJoinTopologyId + "_on_" + address(1));
      checkPoint.trigger("allow_topology_" + postJoinTopologyId + "_on_" + address(2));

      // Wait for the topology to change everywhere
      TestingUtil.waitForRehashToComplete(cache0, cache1, cache2);
View Full Code Here


      // Allow the rebalance to end
      int postJoinTopologyId = duringJoinTopologyId + 1;
      checkPoint.trigger("allow_topology_" + postJoinTopologyId + "_on_" + address(0));
      checkPoint.trigger("allow_topology_" + postJoinTopologyId + "_on_" + address(1));
      checkPoint.trigger("allow_topology_" + postJoinTopologyId + "_on_" + address(2));

      // Wait for the topology to change everywhere
      TestingUtil.waitForRehashToComplete(cache0, cache1, cache2);

      // Check the value on all the nodes
View Full Code Here

         public Object answer(InvocationOnMock invocation) throws Throwable {
            Object[] arguments = invocation.getArguments();
            Address source = (Address) arguments[0];
            int topologyId = (Integer) arguments[1];
            Object result = invocation.callRealMethod();
            checkpoint.trigger("post_get_transactions_" + topologyId + "_from_" + source);
            checkpoint.awaitStrict("resume_get_transactions_" + topologyId + "_from_" + source, 10, SECONDS);
            return result;
         }
      }).when(spyProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySetOf(Integer.class));
View Full Code Here

      // Wait for all (or at least most of) the txs to be replicated to cache 1
      Thread.sleep(1000);

      // Let cache 1 receive the tx from cache 0.
      checkpoint.trigger("resume_get_transactions_" + rebalanceTopologyId + "_from_" + address(1));
      TestingUtil.waitForRehashToComplete(caches(CACHE_NAME));

      // Wait for the txs to finish and check the results
      DataContainer dataContainer0 = TestingUtil.extractComponent(cache0, DataContainer.class);
      DataContainer dataContainer1 = TestingUtil.extractComponent(cache1, DataContainer.class);
View Full Code Here

         public Object answer(InvocationOnMock invocation) throws Throwable {
            Object[] arguments = invocation.getArguments();
            Address source = (Address) arguments[0];
            int topologyId = (Integer) arguments[1];
            Object result = invocation.callRealMethod();
            checkpoint.trigger("post_get_transactions_" + topologyId + "_from_" + source);
            checkpoint.awaitStrict("resume_get_transactions_" + topologyId + "_from_" + source, 10, SECONDS);
            return result;
         }
      }).when(spyProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySetOf(Integer.class));
View Full Code Here

         // Give the rollback command some time to execute on cache 1
         Thread.sleep(1000);
      }

      // Let cache 1 receive the tx from cache 0.
      checkpoint.trigger("resume_get_transactions_" + rebalanceTopologyId + "_from_" + address(1));
      TestingUtil.waitForRehashToComplete(caches(CACHE_NAME));

      // Wait for the tx finish
      future.get(10, SECONDS);
View Full Code Here

         @Override
         public Object answer(InvocationOnMock invocation) throws Throwable {
            Object[] arguments = invocation.getArguments();
            Address source = (Address) arguments[0];
            int topologyId = (Integer) arguments[1];
            checkpoint.trigger("pre_get_transactions_" + topologyId + "_from_" + source);
            checkpoint.awaitStrict("resume_get_transactions_" + topologyId + "_from_" + source, 10, SECONDS);
            return invocation.callRealMethod();
         }
      }).when(spyProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySetOf(Integer.class));
      doAnswer(new Answer<Object>() {
View Full Code Here

      doAnswer(new Answer<Object>() {
         @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));
View Full Code Here

      // Wait for the prepare to lock the key
      prepareBarrier.await(10, SECONDS);

      // Let cache 0 push the tx to cache 1. The CH update will block.
      checkpoint.trigger("resume_get_transactions_" + rebalanceTopologyId + "_from_" + address(1));

      // Let the tx finish. Because the CH update is blocked, the topology won't change.
      prepareBarrier.await(10, SECONDS);
      future.get(10, SECONDS);
View Full Code Here

      prepareBarrier.await(10, SECONDS);
      future.get(10, SECONDS);

      // Let the rebalance finish
      int finalTopologyId = rebalanceTopologyId + 1;
      checkpoint.trigger("resume_ch_update_" + finalTopologyId);
      TestingUtil.waitForRehashToComplete(caches(CACHE_NAME));

      // Check for stale locks
      final TransactionTable tt0 = TestingUtil.extractComponent(cache0, TransactionTable.class);
      final TransactionTable tt1 = TestingUtil.extractComponent(cache1, TransactionTable.class);
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.