Examples of waitForReplicationToOccur()


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

      String key = "key";

      replListener2.expectAny();
      cache1.put(fqn, key, "value1");
      // allow for replication
      replListener2.waitForReplicationToOccur(500);
      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.ReplicationListener.waitForReplicationToOccur()

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

      mgr.commit();

      replListener2.waitForReplicationToOccur(500);

      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.ReplicationListener.waitForReplicationToOccur()

         cache4 = createCache("DifferentGroup");
         replListener2.expectAny();
         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.ReplicationListener.waitForReplicationToOccur()

      ReplicationListener replListener1 = new ReplicationListener(cache1);
      ReplicationListener replListener2 = new ReplicationListener(cache2);

      replListener2.expectAny();
      cache1.put(fqn, "key", "value");
      replListener2.waitForReplicationToOccur(500);
//      TestingUtil.sleepThread(500);// give it time to broadcast the evict call
      // test that this has NOT replicated, but rather has been invalidated:
      assertEquals("value", cache1.get(fqn, "key"));
      assertNull("Should NOT have replicated!", cache2.getNode(fqn));
View Full Code Here

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

      replListener2.expectAny();
      // now test the invalidation:
      cache1.put(fqn, "key2", "value2");
      assertEquals("value2", cache1.get(fqn, "key2"));
//      TestingUtil.sleepThread(500);// give it time to broadcast the evict call
      replListener2.waitForReplicationToOccur(500);

      // since the node already exists even PL will not remove it - but will invalidate it's data
      n = cache2.getNode(fqn);
      assertHasBeenInvalidated(n, "Should have been invalidated");
   }
View Full Code Here

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

      replListener2.expectAny();
      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.ReplicationListener.waitForReplicationToOccur()

      replListener2.expect(PutKeyValueCommand.class, CommitCommand.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.ReplicationListener.waitForReplicationToOccur()

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

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

      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.ReplicationListener.waitForReplicationToOccur()

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

      replListener.expect(PrepareCommand.class);
      mgr1.commit();
      replListener.waitForReplicationToOccur(500);

      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.ReplicationListener.waitForReplicationToOccur()

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

      mgr1.commit();

      replListener.waitForReplicationToOccur(500);

      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
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.