Examples of waitForReplicationToOccur()


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

      ReplicationListener cache2Listener = ReplicationListener.getReplicationListener(cache2);

      cache2Listener.expect(PutKeyValueCommand.class);
      // outside of tx scope
      cache.put("/a", "k", "v");
      cache2Listener.waitForReplicationToOccur(5000);

      assert cache2.get("/a", "k").equals("v");

      // now, a transactional call
      cache1Listener.expect(PrepareCommand.class);
View Full Code Here

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

            ReplicationListener replListener1 = ReplicationListener.getReplicationListener(cache1);
            replListener1.expect(DataGravitationCleanupCommand.class);
            cache2.getInvocationContext().getOptionOverrides().setForceDataGravitation(true);
            Node backupNode = cache2.getNode(fqn);
            replListener1.waitForReplicationToOccur();

           assert backupNode.getChildrenNames().equals(backupNameSet) : "Expecting " + backupNameSet + " but got " + backupNode.getChildrenNames();
         }
         else
         {
View Full Code Here

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

   public void testEvictionOfBackupRegions() throws Exception
   {
      ReplicationListener replicationListener2 = ReplicationListener.getReplicationListener(cache2);
      replicationListener2.expect(PutKeyValueCommand.class);
      cache1.put(fqn, "k", "v");
      replicationListener2.waitForReplicationToOccur();

      assert cache1.peek(fqn, false, false) != null : "Node should exist";
      assert cache2.peek(fqnTransformer.getBackupFqn(cache1.getLocalAddress(), fqn), false, false) != null : "Node should exist on backup";

      // now wait for eviction to kick in - for up to 2 secs
View Full Code Here

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

      String key = "key";

      replListener2.expect(PutKeyValueCommand.class);
      cache1.put(fqn, key, "value1");
      // allow for replication
      replListener2.waitForReplicationToOccur();
      assertEquals("value1", cache1.get(fqn, key));
      assertEquals("value1", cache2.get(fqn, key));

      TransactionManager mgr = cache1.getTransactionManager();
      mgr.begin();
View Full Code Here

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

      cache1.put(fqn, key, "value2");
      assertEquals("value2", cache1.get(fqn, key));
      assertEquals("value1", cache2.get(fqn, key));

      mgr.commit();
      replListener2.waitForReplicationToOccur();

      assertEquals("value2", cache1.get(fqn, key));
      assertEquals("value2", cache2.get(fqn, key));

      mgr.begin();
View Full Code Here

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

         cache4 = createCache("DifferentGroup");
         replListener2.expect(PutKeyValueCommand.class);
         cache1.put("/a/b/c", "age", 38);
         // because we use async repl, modfication may not yet have been propagated to cache2, so
         // we have to wait a little
         replListener2.waitForReplicationToOccur(500);
         assertNull("Should not have replicated", cache3.get("/a/b/c", "age"));
      }
      catch (Exception e)
      {
         fail(e.toString());
View Full Code Here

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

      replListener2.expect(PutKeyValueCommand.class);
      cache.put("/one/two", "key1", pojo);

      mgr.commit();
      replListener2.waitForReplicationToOccur();

      // cache asserts
      assertNull(mgr.getTransaction());
      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
View Full Code Here

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

      replListener2.expect(PutKeyValueCommand.class);
      cache.put("/one/two", "key1", pojo);

      mgr.commit();
      replListener2.waitForReplicationToOccur(1000);

      // cache asserts
      assertNull(mgr.getTransaction());
      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
View Full Code Here

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

      assertNotNull(cache2.get(Fqn.fromString("/one/two"), "key1"));

      replListener2.expect(RemoveNodeCommand.class);
      replListener2.expect();
      cache.removeNode("/one/two");
      replListener2.waitForReplicationToOccur();

      assertEquals(false, cache.exists("/one/two"));
      assertEquals(null, cache.get("/one/two", "key1"));
      assertEquals(false, cache2.exists("/one/two"));
      assertEquals(null, cache2.get("/one/two", "key1"));
View Full Code Here

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

      cacheLister2.expect(PutKeyValueCommand.class);
      cacheLister3.expect(PutKeyValueCommand.class);

      cache1.put("/test", "key", "value");
      cacheLister2.waitForReplicationToOccur();
      cacheLister3.waitForReplicationToOccur();

      assertEquals("value", cache1.get("/test", "key"));
      assertEquals("value", cache2.get("/test", "key"));
      assertEquals("value", cache3.get("/test", "key"));
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.