Thread.sleep(2000);
ReplicationBroker broker =
openReplicationSession(baseDn, 11, 100, replServerPort, 1000, true);
try
{
ChangeNumberGenerator gen = new ChangeNumberGenerator( 11, 0);
// Create a test entry.
String personLdif = "dn: uid=user.2,ou=People," + TEST_ROOT_DN_STRING + "\n"
+ "objectClass: top\n" + "objectClass: person\n"
+ "objectClass: organizationalPerson\n"
+ "objectClass: inetOrgPerson\n" + "uid: user.2\n"
+ "homePhone: 951-245-7634\n"
+ "description: This is the description for Aaccf Amar.\n"
+ "st: NC\n"
+ "mobile: 027-085-0537\n"
+ "postalAddress: Aaccf Amar$17984 Thirteenth Street"
+ "$Rockford, NC 85762\n" + "mail: user.1@example.com\n"
+ "cn: Aaccf Amar\n" + "l: Rockford\n" + "pager: 508-763-4246\n"
+ "street: 17984 Thirteenth Street\n"
+ "telephoneNumber: 216-564-6748\n" + "employeeNumber: 1\n"
+ "sn: Amar\n" + "givenName: Aaccf\n" + "postalCode: 85762\n"
+ "userPassword: password\n" + "initials: AA\n";
Entry tmp = TestCaseUtils.entryFromLdifString(personLdif);
AddOperationBasis addOp =
new AddOperationBasis(connection,
InternalClientConnection.nextOperationID(),
InternalClientConnection.nextMessageID(),
null, tmp.getDN(), tmp.getObjectClasses(),
tmp.getUserAttributes(),
tmp.getOperationalAttributes());
addOp.run();
assertEquals(addOp.getResultCode(), ResultCode.SUCCESS);
long initialCount = getMonitorAttrValue(baseDn, "replayed-updates");
// Get the UUID of the test entry.
Entry resultEntry = getEntry(tmp.getDN(), 1, true);
AttributeType uuidType = DirectoryServer.getAttributeType("entryuuid");
String uuid =
resultEntry.getAttributeValue(uuidType,
DirectoryStringSyntax.DECODER);
// Register a short circuit that will fake a no-such-object result code
// on a delete. This will cause a replication replay loop.
ShortCircuitPlugin.registerShortCircuit(OperationType.DELETE,
"PreParse", 32);
try
{
// Publish a delete message for this test entry.
DeleteMsg delMsg = new DeleteMsg(tmp.getDN().toString(),
gen.newChangeNumber(),
uuid);
broker.publish(delMsg);
// Wait for the operation to be replayed.
long endTime = System.currentTimeMillis() + 5000;