| | |
| | | logError(ErrorLogCategory.SYNCHRONIZATION, |
| | | ErrorLogSeverity.NOTICE, |
| | | "Starting synchronization test : namingConflicts" , 1); |
| | | |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |
| | | /* |
| | |
| | | broker.publish(addMsg); |
| | | |
| | | // Check that the entry has been created in the local DS. |
| | | Entry resultEntry = getEntry(personWithUUIDEntry.getDN(), 1000, true); |
| | | Entry resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, true); |
| | | assertNotNull(resultEntry, |
| | | "The send ADD synchronization message was not applied"); |
| | | entryList.add(resultEntry); |
| | |
| | | |
| | | // check that the modify has been applied as if the entry had been renamed. |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | "telephonenumber", "01 02 45", 1000); |
| | | "telephonenumber", "01 02 45", 10000, true); |
| | | if (found == false) |
| | | fail("The modification has not been correctly replayed."); |
| | | |
| | |
| | | broker.publish(addMsg); |
| | | |
| | | // Check that the entry has been created in the local DS. |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 1000, true); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, true); |
| | | assertNotNull(resultEntry, |
| | | "The ADD synchronization message was not applied"); |
| | | entryList.add(resultEntry); |
| | |
| | | |
| | | // check that the modify has not been applied |
| | | found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | "telephonenumber", "02 01 03 05", 1000); |
| | | "telephonenumber", "02 01 03 05", 10000, false); |
| | | if (found == true) |
| | | fail("The modification has been replayed while it should not."); |
| | | |
| | |
| | | broker.publish(delMsg); |
| | | |
| | | // check that the delete operation has been applied |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 1000, false); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, false); |
| | | |
| | | assertNull(resultEntry, |
| | | "The DELETE synchronization message was not replayed"); |
| | |
| | | broker.publish(addMsg); |
| | | |
| | | // Check that the entry has been created in the local DS. |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 1000, true); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, true); |
| | | assertNotNull(resultEntry, |
| | | "The ADD synchronization message was not applied"); |
| | | entryList.add(resultEntry); |
| | |
| | | // Check that the entry has been renamed and created in the local DS. |
| | | resultEntry = getEntry( |
| | | DN.decode("entryuuid=" + user1entrysecondUUID +" + " + user1dn), |
| | | 1000, true); |
| | | 10000, true); |
| | | assertNotNull(resultEntry, |
| | | "The ADD synchronization message was not applied"); |
| | | |
| | |
| | | new DeleteMsg(personWithSecondUniqueID.getDN().toString(), |
| | | gen.NewChangeNumber(), user1entrysecondUUID); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 1000, false); |
| | | resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, false); |
| | | |
| | | // check that the delete operation has been applied |
| | | assertNull(resultEntry, |
| | |
| | | |
| | | // Check that the entry has been renamed and created in the local DS. |
| | | resultEntry = getEntry( |
| | | DN.decode("uid=new person,ou=People,dc=example,dc=com"), 1000, true); |
| | | DN.decode("uid=new person,ou=People,dc=example,dc=com"), 10000, true); |
| | | assertNotNull(resultEntry, |
| | | "The ADD synchronization message was not applied"); |
| | | |
| | |
| | | gen.NewChangeNumber(), "11111111-9abc-def0-1234-1234567890ab"); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry( |
| | | DN.decode("uid=new person,ou=People,dc=example,dc=com"), 1000, true); |
| | | DN.decode("uid=new person,ou=People,dc=example,dc=com"), 10000, true); |
| | | |
| | | // check that the delete operation has not been applied |
| | | assertNotNull(resultEntry, |
| | |
| | | broker.publish(modDnMsg); |
| | | |
| | | resultEntry = getEntry( |
| | | DN.decode("uid=newrdn,ou=People,dc=example,dc=com"), 1000, true); |
| | | DN.decode("uid=newrdn,ou=People,dc=example,dc=com"), 10000, true); |
| | | |
| | | // check that the operation has been correctly relayed |
| | | assertNotNull(resultEntry, |
| | |
| | | broker.publish(modDnMsg); |
| | | |
| | | resultEntry = getEntry( |
| | | DN.decode("uid=reallynewrdn,ou=People,dc=example,dc=com"), 1000, true); |
| | | DN.decode("uid=reallynewrdn,ou=People,dc=example,dc=com"), 10000, true); |
| | | |
| | | // check that the operation has been correctly relayed |
| | | assertNotNull(resultEntry, |
| | |
| | | broker.publish(addMsg); |
| | | |
| | | // check that the second entry has been added |
| | | resultEntry = getEntry(DN.decode(user1dn), 1000, true); |
| | | resultEntry = getEntry(DN.decode(user1dn), 10000, true); |
| | | |
| | | // check that the add operation has been applied |
| | | assertNotNull(resultEntry, "The add operation was not replayed"); |
| | |
| | | // check that the second entry has been renamed |
| | | resultEntry = getEntry( |
| | | DN.decode("entryUUID = " + user1entrysecondUUID + "+uid=reallynewrdn," + |
| | | "ou=People,dc=example,dc=com"), 1000, true); |
| | | "ou=People,dc=example,dc=com"), 10000, true); |
| | | |
| | | // check that the delete operation has been applied |
| | | assertNotNull(resultEntry, "The modifyDN was not or incorrectly replayed"); |
| | |
| | | gen.NewChangeNumber(), user1entryUUID); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry( |
| | | DN.decode("uid=reallynewrdn,ou=People,dc=example,dc=com"), 1000, false); |
| | | DN.decode("uid=reallynewrdn,ou=People,dc=example,dc=com"), 10000, false); |
| | | |
| | | // check that the delete operation has been applied |
| | | assertNull(resultEntry, |
| | |
| | | resultEntry = getEntry( |
| | | DN.decode("entryUUID = " + user1entrysecondUUID + "+" + |
| | | DN.decode(user1dn).getRDN().toString() + |
| | | "ou=People,dc=example,dc=com"), 1000, false); |
| | | "ou=People,dc=example,dc=com"), 10000, false); |
| | | |
| | | // check that the delete operation has been applied |
| | | assertNull(resultEntry, |
| | |
| | | logError(ErrorLogCategory.SYNCHRONIZATION, |
| | | ErrorLogSeverity.NOTICE, |
| | | "Starting synchronization test : updateOperations " + assured , 1); |
| | | |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |
| | | cleanEntries(); |
| | | |
| | | |
| | | ChangelogBroker broker = openChangelogSession(baseDn, (short) 27); |
| | | try { |
| | | ChangeNumberGenerator gen = new ChangeNumberGenerator((short) 27, 0); |
| | |
| | | /* |
| | | * Check that the entry has been created in the local DS. |
| | | */ |
| | | Entry resultEntry = getEntry(personWithUUIDEntry.getDN(), 1000, true); |
| | | Entry resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, true); |
| | | assertNotNull(resultEntry, |
| | | "The send ADD synchronization message was not applied"); |
| | | entryList.add(resultEntry); |
| | |
| | | broker.publish(modMsg); |
| | | |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | "telephonenumber", "01 02 45", 1000); |
| | | "telephonenumber", "01 02 45", 10000, true); |
| | | |
| | | if (found == false) |
| | | fail("The modification has not been correctly replayed."); |
| | |
| | | broker.publish(moddnMsg); |
| | | |
| | | resultEntry = getEntry( |
| | | DN.decode("uid= new person,ou=People,dc=example,dc=com"), 1000, true); |
| | | DN.decode("uid= new person,ou=People,dc=example,dc=com"), 10000, true); |
| | | |
| | | assertNotNull(resultEntry, |
| | | "The modify DN synchronization message was not applied"); |
| | |
| | | delMsg.setAssured(); |
| | | broker.publish(delMsg); |
| | | resultEntry = getEntry( |
| | | DN.decode("uid= new person,ou=People,dc=example,dc=com"), 1000, false); |
| | | DN.decode("uid= new person,ou=People,dc=example,dc=com"), 10000, false); |
| | | |
| | | assertNull(resultEntry, |
| | | "The DELETE synchronization message was not replayed"); |
| | |
| | | * for the given attrTypeStr attribute type. |
| | | */ |
| | | private boolean checkEntryHasAttribute(DN dn, String attrTypeStr, |
| | | String valueString, int timeout) throws Exception |
| | | String valueString, int timeout, boolean hasAttribute) throws Exception |
| | | { |
| | | // Wait no more than 1 second (synchro operation has to be sent, |
| | | // received and replay) |
| | | boolean found; |
| | | int i = timeout/50; |
| | | if (i<1) |
| | | i=1; |
| | | boolean found = false; |
| | | while ((i> 0) && (!found)) |
| | | |
| | | do |
| | | { |
| | | Thread.sleep(50); |
| | | Entry newEntry = DirectoryServer.getEntry(personWithUUIDEntry.getDN()); |
| | | if (newEntry == null) |
| | | fail("The entry " + personWithUUIDEntry.getDN() + |
| | |
| | | DirectoryServer.getAttributeType(attrTypeStr, true); |
| | | found = tmpAttr.hasValue(new AttributeValue(attrType, valueString)); |
| | | i-- ; |
| | | } |
| | | if (found != hasAttribute) |
| | | Thread.sleep(50); |
| | | } while ((i > 0) && (found != hasAttribute)); |
| | | return found; |
| | | } |
| | | |
| | |
| | | logError(ErrorLogCategory.SYNCHRONIZATION, |
| | | ErrorLogSeverity.NOTICE, |
| | | "Starting synchronization test : deleteNoSuchObject" , 1); |
| | | |
| | | |
| | | DN dn = DN.decode("cn=No Such Object,ou=People,dc=example,dc=com"); |
| | | Operation op = |
| | | new DeleteOperation(connection, |
| | |
| | | logError(ErrorLogCategory.SYNCHRONIZATION, |
| | | ErrorLogSeverity.NOTICE, |
| | | "Starting synchronization test : infiniteReplayLoop" , 1); |
| | | |
| | | |
| | | final DN baseDn = DN.decode("ou=People,dc=example,dc=com"); |
| | | |
| | | Thread.sleep(2000); |