| | |
| | | */ |
| | | package org.opends.server.replication; |
| | | |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.ldap.LDAPAttribute; |
| | | import org.opends.server.protocols.ldap.LDAPModification; |
| | | import org.opends.server.replication.common.ChangeNumber; |
| | | import org.opends.server.replication.common.ChangeNumberGenerator; |
| | | import org.opends.server.replication.common.CSN; |
| | | import org.opends.server.replication.common.CSNGenerator; |
| | | import org.opends.server.replication.plugin.LDAPReplicationDomain; |
| | | import org.opends.server.replication.protocol.*; |
| | | import org.opends.server.replication.service.ReplicationBroker; |
| | |
| | | import org.testng.annotations.DataProvider; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | /** |
| | | * Test synchronization of update operations on the directory server and through |
| | | * the replication server broker interface. |
| | |
| | | * Add an entry in the database |
| | | * |
| | | */ |
| | | private ChangeNumber addEntry(Entry entry) throws Exception |
| | | private CSN addEntry(Entry entry) throws Exception |
| | | { |
| | | AddOperationBasis addOp = new AddOperationBasis(connection, |
| | | InternalClientConnection.nextOperationID(), InternalClientConnection |
| | |
| | | |
| | | assertEquals(addOp.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(getEntry(entry.getDN(), 1000, true)); |
| | | return OperationContext.getChangeNumber((Operation) addOp); |
| | | return OperationContext.getCSN((Operation) addOp); |
| | | } |
| | | |
| | | /** |
| | |
| | | try |
| | | { |
| | | /* |
| | | * Create a Change number generator to generate new changenumbers |
| | | * when we need to send operation messages to the replicationServer. |
| | | * Create a CSN generator to generate new CSNs when we need to send |
| | | * operation messages to the replicationServer. |
| | | */ |
| | | ChangeNumberGenerator gen = new ChangeNumberGenerator(2, 0); |
| | | CSNGenerator gen = new CSNGenerator(2, 0); |
| | | |
| | | |
| | | // Disable the directory server receive status. |
| | |
| | | |
| | | |
| | | // Create and publish an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg(gen.newChangeNumber(), |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN().toString(), |
| | | user1entryUUID, |
| | | baseUUID, |
| | |
| | | setReceiveStatus(synchroServerEntry.getDN().toString(), true); |
| | | |
| | | // Create and publish another update message to add an entry. |
| | | addMsg = new AddMsg(gen.newChangeNumber(), |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN().toString(), |
| | | user1entryUUID, |
| | | baseUUID, |
| | |
| | | // Delete the entries to clean the database. |
| | | DeleteMsg delMsg = |
| | | new DeleteMsg(personWithUUIDEntry.getDN().toString(), |
| | | gen.newChangeNumber(), user1entryUUID); |
| | | gen.newCSN(), user1entryUUID); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, false); |
| | | |
| | |
| | | try |
| | | { |
| | | /* |
| | | * Create a Change number generator to generate new changenumbers |
| | | * when we need to send operation messages to the replicationServer. |
| | | * Create a CSN generator to generate new CSNs when we need to send |
| | | * operation messages to the replicationServer. |
| | | */ |
| | | ChangeNumberGenerator gen = new ChangeNumberGenerator(2, 0); |
| | | CSNGenerator gen = new CSNGenerator(2, 0); |
| | | |
| | | |
| | | // Create and publish an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg(gen.newChangeNumber(), |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN().toString(), |
| | | user1entryUUID, |
| | | baseUUID, |
| | |
| | | |
| | | // Send a first modify operation message. |
| | | List<Modification> mods = generatemods("telephonenumber", "01 02 45"); |
| | | ModifyMsg modMsg = new ModifyMsg(gen.newChangeNumber(), |
| | | ModifyMsg modMsg = new ModifyMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), mods, |
| | | user1entryUUID); |
| | | broker.publish(modMsg); |
| | |
| | | |
| | | // Send a second modify operation message. |
| | | mods = generatemods("description", "Description was changed"); |
| | | modMsg = new ModifyMsg(gen.newChangeNumber(), |
| | | modMsg = new ModifyMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), mods, |
| | | user1entryUUID); |
| | | broker.publish(modMsg); |
| | |
| | | // Delete the entries to clean the database. |
| | | DeleteMsg delMsg = |
| | | new DeleteMsg(personWithUUIDEntry.getDN().toString(), |
| | | gen.newChangeNumber(), user1entryUUID); |
| | | gen.newCSN(), user1entryUUID); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, false); |
| | | |
| | |
| | | |
| | | // A change on a first server. |
| | | long changeTime = TimeThread.getTime(); |
| | | ChangeNumber t1 = new ChangeNumber(changeTime, 0, 3); |
| | | CSN t1 = new CSN(changeTime, 0, 3); |
| | | |
| | | // A change on a second server. |
| | | changeTime++; |
| | | ChangeNumber t2 = new ChangeNumber(changeTime, 0, 4); |
| | | CSN t2 = new CSN(changeTime, 0, 4); |
| | | |
| | | // Simulate the ordering t2:replace:B followed by t1:add:A that |
| | | updateMonitorCount(baseDn, monitorAttr); |
| | |
| | | // t1:replace:displayname |
| | | // A change on a first server. |
| | | changeTime++; |
| | | t1 = new ChangeNumber(changeTime, 0, 3); |
| | | t1 = new CSN(changeTime, 0, 3); |
| | | |
| | | // A change on a second server. |
| | | changeTime++; |
| | | t2 = new ChangeNumber(changeTime, 0, 4); |
| | | t2 = new CSN(changeTime, 0, 4); |
| | | |
| | | // Simulate the ordering t2:delete:displayname followed by t1:replace:A |
| | | updateMonitorCount(baseDn, monitorAttr); |
| | |
| | | |
| | | try |
| | | { |
| | | /* |
| | | * Create a Change number generator to generate new changenumbers |
| | | * when we need to send operations messages to the replicationServer. |
| | | */ |
| | | ChangeNumberGenerator gen = new ChangeNumberGenerator( 2, 0); |
| | | /* |
| | | * Create a CSN generator to generate new CSNs when we need to send |
| | | * operations messages to the replicationServer. |
| | | */ |
| | | CSNGenerator gen = new CSNGenerator( 2, 0); |
| | | |
| | | /* |
| | | * Test that the conflict resolution code is able to find entries |
| | |
| | | * Finally check that the modify operation has been applied. |
| | | */ |
| | | // create the entry with a given DN |
| | | AddMsg addMsg = new AddMsg(gen.newChangeNumber(), |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN().toString(), |
| | | user1entryUUID, |
| | | baseUUID, |
| | |
| | | |
| | | // send a modify operation with the correct unique ID but another DN |
| | | List<Modification> mods = generatemods("telephonenumber", "01 02 45"); |
| | | ModifyMsg modMsg = new ModifyMsg(gen.newChangeNumber(), |
| | | ModifyMsg modMsg = new ModifyMsg(gen.newCSN(), |
| | | DN.decode("cn=something,ou=People," + TEST_ROOT_DN_STRING), mods, |
| | | user1entryUUID); |
| | | updateMonitorCount(baseDn, resolvedMonitorAttr); |
| | |
| | | // send a modify operation attempting to replace the RDN entry |
| | | // with a new value |
| | | mods = generatemods("uid", "AnotherUid"); |
| | | modMsg = new ModifyMsg(gen.newChangeNumber(), |
| | | modMsg = new ModifyMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), mods, |
| | | user1entryUUID); |
| | | |
| | |
| | | */ |
| | | |
| | | // create the entry with a given DN and unique ID |
| | | addMsg = new AddMsg(gen.newChangeNumber(), |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN().toString(), |
| | | user1entryUUID, baseUUID, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | |
| | | |
| | | // send a modify operation with a wrong unique ID but the same DN |
| | | mods = generatemods("telephonenumber", "02 01 03 05"); |
| | | modMsg = new ModifyMsg(gen.newChangeNumber(), |
| | | modMsg = new ModifyMsg(gen.newCSN(), |
| | | DN.decode(user1dn), mods, "10000000-9abc-def0-1234-1234567890ab"); |
| | | updateMonitorCount(baseDn, resolvedMonitorAttr); |
| | | AlertCount = DummyAlertHandler.getAlertCount(); |
| | |
| | | // used above |
| | | DeleteMsg delMsg = |
| | | new DeleteMsg("cn=anotherdn,ou=People," + TEST_ROOT_DN_STRING, |
| | | gen.newChangeNumber(), user1entryUUID); |
| | | gen.newCSN(), user1entryUUID); |
| | | updateMonitorCount(baseDn, resolvedMonitorAttr); |
| | | AlertCount = DummyAlertHandler.getAlertCount(); |
| | | broker.publish(delMsg); |
| | |
| | | */ |
| | | |
| | | // create an entry with a given DN and unique ID |
| | | addMsg = new AddMsg(gen.newChangeNumber(), |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN().toString(), |
| | | user1entryUUID, baseUUID, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | |
| | | "The ADD replication message was not applied"); |
| | | |
| | | // create an entry with the same DN and another unique ID |
| | | addMsg = new AddMsg(gen.newChangeNumber(), |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | personWithSecondUniqueID.getDN().toString(), |
| | | user1entrysecondUUID, baseUUID, |
| | | personWithSecondUniqueID.getObjectClassAttribute(), |
| | |
| | | // delete the entries to clean the database. |
| | | delMsg = |
| | | new DeleteMsg(personWithUUIDEntry.getDN().toString(), |
| | | gen.newChangeNumber(), user1entryUUID); |
| | | gen.newCSN(), user1entryUUID); |
| | | broker.publish(delMsg); |
| | | delMsg = |
| | | new DeleteMsg(personWithSecondUniqueID.getDN().toString(), |
| | | gen.newChangeNumber(), user1entrysecondUUID); |
| | | gen.newCSN(), user1entrysecondUUID); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, false); |
| | | resultEntry = getEntry(personWithSecondUniqueID.getDN(), 10000, false); |
| | |
| | | * Simulate this by trying to add an entry below a DN that does not |
| | | * exist but with a parent ID that exist. |
| | | */ |
| | | addMsg = new AddMsg(gen.newChangeNumber(), |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | "uid=new person,o=nothere,o=below,ou=People," + TEST_ROOT_DN_STRING, |
| | | user1entryUUID, |
| | | baseUUID, |
| | |
| | | |
| | | delMsg = |
| | | new DeleteMsg("uid=new person,ou=People," + TEST_ROOT_DN_STRING, |
| | | gen.newChangeNumber(), "11111111-9abc-def0-1234-1234567890ab"); |
| | | gen.newCSN(), "11111111-9abc-def0-1234-1234567890ab"); |
| | | updateMonitorCount(baseDn, resolvedMonitorAttr); |
| | | AlertCount = DummyAlertHandler.getAlertCount(); |
| | | broker.publish(delMsg); |
| | |
| | | */ |
| | | |
| | | ModifyDNMsg modDnMsg = new ModifyDNMsg( |
| | | "uid=new person,ou=People," + TEST_ROOT_DN_STRING, gen.newChangeNumber(), |
| | | "uid=new person,ou=People," + TEST_ROOT_DN_STRING, gen.newCSN(), |
| | | user1entryUUID, baseUUID, false, |
| | | "uid=wrong, ou=people," + TEST_ROOT_DN_STRING, |
| | | "uid=newrdn"); |
| | |
| | | */ |
| | | |
| | | modDnMsg = new ModifyDNMsg( |
| | | "uid=wrong,ou=People," + TEST_ROOT_DN_STRING, gen.newChangeNumber(), |
| | | "uid=wrong,ou=People," + TEST_ROOT_DN_STRING, gen.newCSN(), |
| | | user1entryUUID, null, false, null, "uid=reallynewrdn"); |
| | | updateMonitorCount(baseDn, resolvedMonitorAttr); |
| | | AlertCount = DummyAlertHandler.getAlertCount(); |
| | |
| | | */ |
| | | |
| | | // add a second entry |
| | | addMsg = new AddMsg(gen.newChangeNumber(), |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | user1dn, |
| | | user1entrysecondUUID, |
| | | baseUUID, |
| | |
| | | assertNotNull(resultEntry, "The add operation was not replayed"); |
| | | |
| | | // try to rename the first entry |
| | | modDnMsg = new ModifyDNMsg(user1dn, gen.newChangeNumber(), |
| | | modDnMsg = new ModifyDNMsg(user1dn, gen.newCSN(), |
| | | user1entrysecondUUID, baseUUID, false, |
| | | baseDn.toString(), "uid=reallynewrdn"); |
| | | updateMonitorCount(baseDn, unresolvedMonitorAttr); |
| | |
| | | new DeleteMsg("entryUUID = " + user1entrysecondUUID + "+" + |
| | | DN.decode(user1dn).getRDN().toString() + |
| | | ",ou=People," + TEST_ROOT_DN_STRING, |
| | | gen.newChangeNumber(), user1entrysecondUUID); |
| | | gen.newCSN(), user1entrysecondUUID); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry( |
| | | DN.decode("entryUUID = " + user1entrysecondUUID + "+" + |
| | |
| | | |
| | | delMsg = |
| | | new DeleteMsg("uid=reallynewrdn,ou=People," + TEST_ROOT_DN_STRING, |
| | | gen.newChangeNumber(), user1entryUUID); |
| | | gen.newCSN(), user1entryUUID); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry( |
| | | DN.decode("uid=reallynewrdn,ou=People," + TEST_ROOT_DN_STRING), 10000, false); |
| | |
| | | "Entry not added: ou=baseDn1,"+baseDn); |
| | | |
| | | // - create Add Msg for user1 with parent entry 1 UUID |
| | | addMsg = new AddMsg(gen.newChangeNumber(), |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | "uid=new person,ou=baseDn1,"+baseDn, |
| | | user1entryUUID, |
| | | getEntryUUID(DN.decode("ou=baseDn1,"+baseDn)), |
| | |
| | | |
| | | // add domain1 entry with 2 children : domain2 and domain3 |
| | | addEntry(domain1); |
| | | ChangeNumber olderCn = gen.newChangeNumber(); |
| | | CSN olderCSN = gen.newCSN(); |
| | | Thread.sleep(1000); |
| | | domain1uid = getEntryUUID(DN.decode(domain1dn)); |
| | | addEntry(domain2); |
| | |
| | | AlertCount = DummyAlertHandler.getAlertCount(); |
| | | |
| | | // delete domain1 |
| | | delMsg = new DeleteMsg(domain1dn, olderCn, domain1uid); |
| | | delMsg = new DeleteMsg(domain1dn, olderCSN, domain1uid); |
| | | broker.publish(delMsg); |
| | | |
| | | // check that the domain1 has correctly been deleted |
| | |
| | | domain1uid = getEntryUUID(DN.decode(domain1dn)); |
| | | addEntry(domain2); |
| | | domain2uid = getEntryUUID(DN.decode(domain2dn)); |
| | | ChangeNumber addCn = addEntry(domain3); |
| | | gen.adjust(addCn); |
| | | CSN addCSN = addEntry(domain3); |
| | | gen.adjust(addCSN); |
| | | domain3uid = getEntryUUID(DN.decode(domain3dn)); |
| | | |
| | | updateMonitorCount(baseDn, unresolvedMonitorAttr); |
| | | AlertCount = DummyAlertHandler.getAlertCount(); |
| | | |
| | | // delete domain1 |
| | | delMsg = new DeleteMsg(domain1dn, gen.newChangeNumber(), domain1uid); |
| | | delMsg = new DeleteMsg(domain1dn, gen.newCSN(), domain1uid); |
| | | broker.publish(delMsg); |
| | | |
| | | // check that the domain1 has correctly been deleted |
| | |
| | | // that is currently deleted on another master, the replay of the |
| | | // add on the second master cause the added entry to be renamed |
| | | // |
| | | addMsg = new AddMsg(gen.newChangeNumber(), domain2dn, domain2uid, |
| | | addMsg = new AddMsg(gen.newCSN(), domain2dn, domain2uid, |
| | | domain1uid, |
| | | domain2.getObjectClassAttribute(), |
| | | domain2.getAttributes(), new ArrayList<Attribute>()); |
| | |
| | | // this is correctly detected as a resolved conflict. |
| | | // To simulate this simply try a modifyDN on a non existent uid. |
| | | modDnMsg = new ModifyDNMsg( |
| | | "uid=new person,ou=People," + TEST_ROOT_DN_STRING, gen.newChangeNumber(), |
| | | "uid=new person,ou=People," + TEST_ROOT_DN_STRING, gen.newCSN(), |
| | | "33343333-3533-3633-3373-333333833333", baseUUID, false, |
| | | "uid=wrong, ou=people," + TEST_ROOT_DN_STRING, |
| | | "uid=newrdn"); |
| | |
| | | updateMonitorCount(baseDn, unresolvedMonitorAttr); |
| | | AlertCount = DummyAlertHandler.getAlertCount(); |
| | | modDnMsg = new ModifyDNMsg( |
| | | "uid=new person,ou=People," + TEST_ROOT_DN_STRING, gen.newChangeNumber(), |
| | | "uid=new person,ou=People," + TEST_ROOT_DN_STRING, gen.newCSN(), |
| | | "33333333-3333-3333-3333-333333333333", |
| | | "12343333-3533-3633-3333-333333833333" , false, |
| | | "uid=wrong, ou=people," + TEST_ROOT_DN_STRING, |
| | |
| | | openReplicationSession(baseDn, 27, 100, replServerPort, 2000, true); |
| | | |
| | | try { |
| | | ChangeNumberGenerator gen = new ChangeNumberGenerator( 27, 0); |
| | | CSNGenerator gen = new CSNGenerator( 27, 0); |
| | | |
| | | /* |
| | | * Test that operations done on this server are sent to the |
| | |
| | | * |
| | | * Start by testing the Add message reception |
| | | */ |
| | | AddMsg addMsg = new AddMsg(gen.newChangeNumber(), |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN().toString(), |
| | | user1entryUUID, baseUUID, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | |
| | | /* |
| | | * Test the reception of Modify Msg |
| | | */ |
| | | modMsg = new ModifyMsg(gen.newChangeNumber(), personWithUUIDEntry.getDN(), |
| | | modMsg = new ModifyMsg(gen.newCSN(), personWithUUIDEntry.getDN(), |
| | | mods, user1entryUUID); |
| | | if (assured) |
| | | modMsg.setAssured(true); |
| | |
| | | // Test that replication is able to add attribute that do |
| | | // not exist in the schema. |
| | | List<Modification> invalidMods = generatemods("badattribute", "value"); |
| | | modMsg = new ModifyMsg(gen.newChangeNumber(), personWithUUIDEntry.getDN(), |
| | | modMsg = new ModifyMsg(gen.newCSN(), personWithUUIDEntry.getDN(), |
| | | invalidMods, user1entryUUID); |
| | | if (assured) |
| | | modMsg.setAssured(true); |
| | |
| | | * Test the Reception of Modify Dn Msg |
| | | */ |
| | | moddnMsg = new ModifyDNMsg(personWithUUIDEntry.getDN().toString(), |
| | | gen.newChangeNumber(), |
| | | gen.newCSN(), |
| | | user1entryUUID, null, |
| | | true, null, "uid= new person"); |
| | | if (assured) |
| | |
| | | * Test the Reception of Delete Msg |
| | | */ |
| | | delMsg = new DeleteMsg("uid= new person,ou=People," + TEST_ROOT_DN_STRING, |
| | | gen.newChangeNumber(), user1entryUUID); |
| | | gen.newCSN(), user1entryUUID); |
| | | if (assured) |
| | | delMsg.setAssured(true); |
| | | broker.publish(delMsg); |
| | |
| | | openReplicationSession(baseDn, 11, 100, replServerPort, 1000, true); |
| | | try |
| | | { |
| | | ChangeNumberGenerator gen = new ChangeNumberGenerator( 11, 0); |
| | | CSNGenerator gen = new CSNGenerator( 11, 0); |
| | | |
| | | // Create a test entry. |
| | | String personLdif = "dn: uid=user.2,ou=People," + TEST_ROOT_DN_STRING + "\n" |
| | |
| | | { |
| | | // Publish a delete message for this test entry. |
| | | DeleteMsg delMsg = new DeleteMsg(tmp.getDN().toString(), |
| | | gen.newChangeNumber(), |
| | | gen.newCSN(), |
| | | uuid); |
| | | broker.publish(delMsg); |
| | | |
| | |
| | | } |
| | | /** |
| | | * Test that the ReplicationDomain (plugin inside LDAP server) adjust |
| | | * its internal change number generator to the last change number |
| | | * received. Steps: |
| | | * - create a domain with the current date in the CN generator |
| | | * - make it receive an update with a CN in the future |
| | | * its internal CSN generator to the last CSN received. Steps: |
| | | * - create a domain with the current date in the CSN generator |
| | | * - make it receive an update with a CSN in the future |
| | | * - do a local operation replicated on that domain |
| | | * - check that the update generated for that operation has a CN in the |
| | | * - check that the update generated for that operation has a CSN in the |
| | | * future. |
| | | * @throws Exception |
| | | */ |
| | | @Test(enabled=true) |
| | | public void CNGeneratorAdjust() throws Exception |
| | | public void csnGeneratorAdjust() throws Exception |
| | | { |
| | | int serverId = 88; |
| | | logError(Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "Starting synchronization test : CNGeneratorAdjust")); |
| | | "Starting synchronization test : CSNGeneratorAdjust")); |
| | | |
| | | final DN baseDn = DN.decode("ou=People," + TEST_ROOT_DN_STRING); |
| | | |
| | |
| | | try |
| | | { |
| | | /* |
| | | * Create a Change number generator to generate new changenumbers |
| | | * Create a CSN generator to generate new CSNs |
| | | * when we need to send operation messages to the replicationServer. |
| | | */ |
| | | long inTheFutur = System.currentTimeMillis() + (3600 * 1000); |
| | | ChangeNumberGenerator gen = new ChangeNumberGenerator(serverId, inTheFutur); |
| | | CSNGenerator gen = new CSNGenerator(serverId, inTheFutur); |
| | | |
| | | // Create and publish an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg( |
| | | gen.newChangeNumber(), |
| | | gen.newCSN(), |
| | | user3dn.toString(), |
| | | user3UUID, |
| | | baseUUID, |
| | |
| | | assertTrue(msg instanceof ModifyMsg, |
| | | "The received replication message is not a MODIFY msg"); |
| | | ModifyMsg modMsg = (ModifyMsg) msg; |
| | | assertEquals(addMsg.getChangeNumber().getTimeSec(), |
| | | modMsg.getChangeNumber().getTimeSec(), |
| | | assertEquals(addMsg.getCSN().getTimeSec(), |
| | | modMsg.getCSN().getTimeSec(), |
| | | "The MOD timestamp should have been adjusted to the ADD one"); |
| | | |
| | | // Delete the entries to clean the database. |
| | | DeleteMsg delMsg = |
| | | new DeleteMsg( |
| | | user3Entry.getDN().toString(), |
| | | gen.newChangeNumber(), |
| | | gen.newCSN(), |
| | | user3UUID); |
| | | broker.publish(delMsg); |
| | | |