// before the deleted is replayed gets renamed correctly.
//
// add domain1 entry with 2 children : domain2 and domain3
addEntry(domain1);
ChangeNumber olderCn = gen.newChangeNumber();
Thread.sleep(1000);
domain1uid = getEntryUUID(DN.decode(domain1dn));
addEntry(domain2);
domain2uid = getEntryUUID(DN.decode(domain2dn));
addEntry(domain3);
domain3uid = getEntryUUID(DN.decode(domain3dn));
DN conflictDomain2dn = DN.decode(
"entryUUID = " + domain2uid + "+dc=domain2,ou=people," + TEST_ROOT_DN_STRING);
DN conflictDomain3dn = DN.decode(
"entryUUID = " + domain3uid + "+dc=domain3,ou=people," + TEST_ROOT_DN_STRING);
updateMonitorCount(baseDn, unresolvedMonitorAttr);
AlertCount = DummyAlertHandler.getAlertCount();
// delete domain1
delMsg = new DeleteMsg(domain1dn, olderCn, domain1uid);
broker.publish(delMsg);
// check that the domain1 has correctly been deleted
assertNull(getEntry(DN.decode(domain1dn), 10000, false),
"The DELETE replication message was not replayed");
// check that domain2 and domain3 have been renamed
assertNotNull(getEntry(conflictDomain2dn, 1000, true),
"The conflicting entries were not created");
assertNotNull(getEntry(conflictDomain3dn, 1000, true),
"The conflicting entries were not created");
// check that the 2 conflicting entries have been correctly marked
assertTrue(checkEntryHasAttribute(conflictDomain2dn,
LDAPReplicationDomain.DS_SYNC_CONFLICT, domain2dn, 1000, true));
assertTrue(checkEntryHasAttribute(conflictDomain3dn,
LDAPReplicationDomain.DS_SYNC_CONFLICT, domain3dn, 1000, true));
// check that unresolved conflict count has been incremented
assertEquals(getMonitorDelta(), 1);
// Check that an administrative alert was generated
// because the conflict has not been automatically resolved.
assertEquals(DummyAlertHandler.getAlertCount(), AlertCount+2,
"An alert was incorrectly generated when resolving conflicts");
// delete the resulting entries for the next test
delEntry(conflictDomain2dn);
delEntry(conflictDomain3dn);
//
// Check that when a delete is replayed over an entry which has child
// those child are also deleted
//
// add domain1 entry with 2 children : domain2 and domain3
addEntry(domain1);
domain1uid = getEntryUUID(DN.decode(domain1dn));
addEntry(domain2);
domain2uid = getEntryUUID(DN.decode(domain2dn));
ChangeNumber addCn = addEntry(domain3);
gen.adjust(addCn);
domain3uid = getEntryUUID(DN.decode(domain3dn));
updateMonitorCount(baseDn, unresolvedMonitorAttr);
AlertCount = DummyAlertHandler.getAlertCount();