Package org.infinispan.test.concurrent

Examples of org.infinispan.test.concurrent.StateSequencer.advance()


            matchCommand(LockControlCommand.class).withCache(CACHE_NAME).build())
            .before("tx:block_remote_lock", "tx:resume_remote_lock");


      // Wait for the rebalance to start
      sequencer.advance("tx:before_lock");
      assertEquals(rebalanceTopologyId, stm0.getCacheTopology().getTopologyId());

      // Start a transaction on cache 0
      MagicKey key = new MagicKey("testkey", cache0);
      tm0.begin();
View Full Code Here


      tm0.begin();
      cache0.lock(key);
      tm0.commit();

      // Let the rebalance finish
      sequencer.advance("tx:after_commit");

      TestingUtil.waitForRehashToComplete(caches(CACHE_NAME));
      assertEquals(finalTopologyId, stm0.getCacheTopology().getTopologyId());

      // Check for stale locks
View Full Code Here

      advanceOnInterceptor(sequencer, cache(2), StateTransferInterceptor.class,
            matchCommand(RollbackCommand.class).build())
            .after("tx1:after_rollback_on_backup");

      assertEquals(Arrays.asList(address(1), address(2)), advancedCache(0).getDistributionManager().locate(TEST_KEY));
      sequencer.advance("tx1:begin");

      tm(0).begin();
      cache(0).put(TEST_KEY, TX1_VALUE);
      tm(0).commit();
View Full Code Here

      tm(0).begin();
      cache(0).put(TEST_KEY, TX1_VALUE);
      tm(0).commit();

      sequencer.advance("tx2:begin");
      LockManager lockManager1 = TestingUtil.extractLockManager(cache(1));
      assertFalse(lockManager1.isLocked(TEST_KEY));

      tm(0).begin();
      cache(0).put(TEST_KEY, TX2_VALUE);
View Full Code Here

      tm(0).begin();
      cache(0).put(TEST_KEY, TX2_VALUE);
      tm(0).commit();

      checkValue();
      sequencer.advance("tx2:end");

      sequencer.advance("tx1:check");
      checkValue();
   }
View Full Code Here

      tm(0).commit();

      checkValue();
      sequencer.advance("tx2:end");

      sequencer.advance("tx1:check");
      checkValue();
   }

   private void checkValue() {
      for (Cache cache : caches()) {
View Full Code Here

            return null;
         }
      });


      sequencer.advance("tx1:begin");

      tm(0).begin();
      cache(0).put(TEST_KEY, TX1_VALUE);
      tm(0).commit();
View Full Code Here

      tm(0).begin();
      cache(0).put(TEST_KEY, TX1_VALUE);
      tm(0).commit();

      sequencer.advance("tx1:check");
      assertFalse(TestingUtil.extractLockManager(cache(1)).isLocked(TEST_KEY));
      lockCheckFuture.get(10, TimeUnit.SECONDS);
   }
}
View Full Code Here

      final int currentTopologyId = TestingUtil.extractComponentRegistry(primaryOwnerCache).getStateTransferManager().getCacheTopology().getTopologyId();
      Future<Object> secondCommitFuture = fork(new Callable<Object>() {
         @Override
         public Object call() throws Exception {
            // Wait for the commit command to block replaying the prepare on the new backup
            sequencer.advance("sim:before_extra_commit");
            // And try to run another commit command
            CommitCommand command = new CommitCommand(newBackupOwnerCache.getName(), gtx);
            command.setTopologyId(currentTopologyId);
            CommandsFactory cf = TestingUtil.extractCommandsFactory(newBackupOwnerCache);
            cf.initializeReplicableCommand(command, true);
View Full Code Here

            matchCommand(RollbackCommand.class).build())
            .after("backup:after_rollback");


      assertEquals(Arrays.asList(address(1), address(2)), advancedCache(0).getDistributionManager().locate(TEST_KEY));
      sequencer.advance("main:start");

      tm(0).begin();
      cache(0).put(TEST_KEY, TX1_VALUE);
      try {
         tm(0).commit();
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.