* <tt>replQueueInterval</tt> is reached.
*/
public void testReplicationBasedOnTime() throws Exception {
//only place one element, queue size is 10.
cache1.put("key", "value");
ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class);
assertNotNull(replicationQueue);
assertEquals(1, replicationQueue.getElementsCount());
assertNull(cache2.get("key"));
assertEquals("value", cache1.get("key"));
replicationQueue.flush();
// Now wait until values are replicated properly
eventually(new Condition() {
@Override
public boolean isSatisfied() throws Exception {
return cache2.get("key") != null;
}
});
assertEquals(cache2.get("key"), "value");
assertEquals(0, replicationQueue.getElementsCount());
}