Examples of expectAny()


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

     
      // test a very simple replication.
      Fqn fqn = Fqn.fromString("/a");
      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));
View Full Code Here

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

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

      TransactionManager mgr = cache1.getTransactionManager();
      mgr.begin();

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

      mgr.commit();
View Full Code Here

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

      CacheSPI<Object, Object> cache3 = null, cache4 = null;
      try
      {
         cache3 = createCache("DifferentGroup");
         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"));
View Full Code Here

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

      Fqn fqn = Fqn.fromString("/a/b");
      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"));
View Full Code Here

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

      // since the node already exists even PL will not remove it - but will invalidate it's data
      Node n = cache1.getNode(fqn);
      assertHasBeenInvalidated(n, "Should have been invalidated");
      assertEquals("value", cache2.get(fqn, "key"));

      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);
View Full Code Here

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

      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());

      SamplePojo pojo = new SamplePojo(21, "test");

      replListener2.expectAny();
      cache.put("/one/two", "key1", pojo);

      mgr.commit();
      replListener2.waitForReplicationToOccur(1000);
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.