Package org.jboss.cache.util.internals

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


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

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

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

      mgr.commit();
      replListener2.waitForReplicationToOccur(1000);
View Full Code Here


      assertEquals(false, lockManager2.isLocked(cache2.getNode("/one")));
      assertEquals(false, lockManager2.isLocked(cache2.getNode("/one/two")));
      assertNotNull(cache2.getNode("/one").getChild("two"));
      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"));
View Full Code Here

      assertEquals(false, lockManager2.isLocked(cache2.getNode("/one/two")));
      assertNotNull(cache2.getNode("/one").getChild("two"));
      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"));
View Full Code Here

      assertEquals("value", cache1.get(fqn, key));
      assertNull(cache2.get(fqn, key));
      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));
View Full Code Here

      createCaches(false, true);

      ReplicationListener replListener = new ReplicationListener(cache2);

      mgr1.begin();
      replListener.expect(CommitCommand.class);
      cache1.put(fqn, key, "value");

      assertEquals("value", cache1.get(fqn, key));
      assertNull(cache2.get(fqn, key));
      assertNull(loader1.get(fqn));
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.