Examples of waitForReplicationToOccur()


Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      ReplicationListener replListener0 = replListeners[0];
      replListener0.expectWithTx(PutDataMapCommand.class);
     
      Request req = new Request(mgr3, null, sas);
      req.execute();     
      replListener0.waitForReplicationToOccur();     
     
      String sessionId = sas.getSessionId();
      assert sessionId != null : "session id is null";
      // validate cache contents
      BuddyReplicationAssertions.assertBuddyBackup(contextHostName, sessionId, mgr3.getCache(), mgr0.getCache());
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
      replListener0.expectWithTx(PutDataMapCommand.class);
     
      req = new Request(mgr3, sessionId, sas);
      req.execute();     
      replListener0.waitForReplicationToOccur();     

      // Passivate the session
      mgr0.passivate(sessionId);
      mgr1.passivate(sessionId);
      mgr2.passivate(sessionId);
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
      replListener0.expectWithTx(PutDataMapCommand.class);
     
      req = new Request(mgr3, sessionId, sas);
      req.execute();
      replListener0.waitForReplicationToOccur();     

      // Invalidate the session
      sas = new SetAttributesServlet(Collections.singletonMap(KEY, getAttributeValue(attr++)));
      InvalidationServlet invs = new InvalidationServlet();
      MultipleActionServlet mas = new MultipleActionServlet(sas, invs);
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      assertNull(loader1.get(fqn));
      assertNull(loader2.get(fqn));

      replListener.expectWithTx(PutKeyValueCommand.class);
      mgr1.commit();
      replListener.waitForReplicationToOccur();

      assertEquals("value", cache1.get(fqn, key));
      assertEquals("value", cache2.get(fqn, key));
      assertEquals("value", loader1.get(fqn).get(key));
      assertEquals("value", loader2.get(fqn).get(key));
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      assertNull(loader1.get(fqn));
      assertNull(loader2.get(fqn));

      mgr1.commit();

      replListener.waitForReplicationToOccur();

      assertEquals("value", cache1.get(fqn, key));
      assertEquals("value", cache2.get(fqn, key));
      assertEquals("value", loader1.get(fqn).get(key));
      assertEquals("value", loader2.get(fqn).get(key));
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      replListener1.expectWithTx(PutDataMapCommand.class, RemoveNodeCommand.class);
      replListener1.expect(DataGravitationCleanupCommand.class);

      req = new Request(mgr0, sessionId, mas);
      req.execute();     
      replListener1.waitForReplicationToOccur();

      TestingUtil.dumpCacheContents(mgr0.getCache(), mgr1.getCache(), mgr2.getCache(), mgr3.getCache());

      BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr0.getCache());
      BuddyReplicationAssertions.assertUnrelated(contextHostName, sessionId, mgr1.getCache());
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      ReplicationListener replListener1 = ReplicationListener.getReplicationListener(caches.get(1));
      replListener0.expect(DataGravitationCleanupCommand.class);
      replListener1.expect(DataGravitationCleanupCommand.class);
      caches.get(2).getNode(fqn)// expectWithTx entire subtree to gravitate.
      replListener0.waitForReplicationToOccur(); // cleanup commands are async
      replListener1.waitForReplicationToOccur(); // also wait untill the backup is cleaned

      Fqn newBackupFqn = fqnTransformer.getBackupFqn(caches.get(2).getLocalAddress(), fqn);
      Fqn newBackupFqn2 = fqnTransformer.getBackupFqn(caches.get(2).getLocalAddress(), fqn2);

      assertEquals(value, caches.get(2).get(fqn, key));
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      ReplicationListener replListener0 = ReplicationListener.getReplicationListener(caches.get(0));

      replListener0.expect(PutKeyValueCommand.class);
      caches.get(2).put(fqn, key, value);
      replListener0.waitForReplicationToOccur();


      TestingUtil.dumpCacheContents(caches);

      assertEquals("Value should exist", value, caches.get(2).get(fqn, key));
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

      replListener0.expect(DataGravitationCleanupCommand.class);

      // according to data gravitation, a call to *any* cache should retrieve the data, and move the data to the new cache.
      assertEquals("Value should have gravitated", value, caches.get(1).get(fqn, key));
      replListener0.waitForReplicationToOccur();

      // use exists instead of get() to prevent going up the interceptor stack
      assert caches.get(0).peek(fqnTransformer.getBackupRoot(caches.get(1).getLocalAddress()), false) != null : "Should have new buddy's backup root.";
      assert caches.get(0).peek(fqnTransformer.getBackupRoot(caches.get(0).getLocalAddress()), false) == null : "Should not have self as a backup root.";
      assert caches.get(0).peek(fqnTransformer.getBackupRoot(cache2Addr), false) == null : "Should not have dead node as a backup root.";
View Full Code Here

Examples of org.jboss.cache.util.internals.replicationlisteners.ReplicationListener.waitForReplicationToOccur()

         TransactionManager transactionManager = cache1.getTransactionManager();

         transactionManager.begin();
         assert cache1.get(fqn, "key").equals("val");
         transactionManager.commit();
         replicationListener.waitForReplicationToOccur(1000);

         assert !cache0.exists(fqn);

      } finally
      {
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.