{
fail(e.getMessage());
}
// Create an update message to add an entry.
AddMsg addMsg = new AddMsg(gen.newChangeNumber(),
entry.getDN().toString(),
ENTRY_UUID,
null,
entry.getObjectClassAttribute(),
entry.getAttributes(), new ArrayList<Attribute>());
replicationDomain.publish(addMsg);
/*
* check that entry has been created and has attribute values from RDN
* only
*/
Entry newEntry = null;
try
{
newEntry = getEntry(entry.getDN(), TIMEOUT, true);
} catch(Exception e)
{
fail("Entry has not been added: " + e.getMessage());
}
assertNotNull(newEntry);
assertEquals(entry.getDN(), newEntry.getDN());
ObjectClass objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase());
assertTrue(newEntry.hasObjectClass(objectClass));
checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept");
checkEntryAttributeValue(newEntry, "carLicense", "cirLicenseValue");
/**
* Now perform same test, but with 2 forbidden attributes in RDN, using '+'
*/
/*
* Perform add operation with fornbidden attribute in RDN
*/
entryLdif = "dn: displayName=ValueToBeKept+description=ValueToBeKeptToo," +
TEST_ROOT_DN_STRING + "\n" + "objectClass: top\n" +
"objectClass: person\n" + "objectClass: organizationalPerson\n" +
"objectClass: inetOrgPerson\n" + "sn: snValue\n" + "cn: cnValue\n" +
"entryUUID: " + ENTRY_UUID2 + "\n" +
"displayName: ValueToBeKept\ndisplayName: displayNameValue\n" +
"description: descriptionValue\ndescription: ValueToBeKeptToo\n" +
"carLicense: cirLicenseValue\n";
try
{
entry = TestCaseUtils.entryFromLdifString(entryLdif);
} catch (Exception e)
{
fail(e.getMessage());
}
// Create an update message to add an entry.
addMsg = new AddMsg(gen.newChangeNumber(),
entry.getDN().toString(),
ENTRY_UUID2,
null,
entry.getObjectClassAttribute(),
entry.getAttributes(), new ArrayList<Attribute>());