importing a group with a multi-valued rep:principalName property
- nonProtected node rep:Group must be created.
- protected property rep:principalName must be ignored
- saving changes must fail with ConstraintViolationEx.
*/
NodeImpl target = (NodeImpl) sImpl.getNode(umgr.getGroupsPath());
try {
doImport(target, xml);
assertTrue(target.isModified());
assertTrue(sImpl.hasPendingChanges());
Authorizable newGroup = umgr.getAuthorizable("g");
assertNotNull(newGroup);
assertTrue(target.hasNode("g"));
assertTrue(target.hasProperty("g/rep:principalName"));
assertFalse(target.getProperty("g/rep:principalName").getDefinition().isProtected());
// saving changes of the import -> must fail as mandatory prop is missing
try {
sImpl.save();
fail("Import must be incomplete. Saving changes must fail.");
} catch (ConstraintViolationException e) {
// success
}
} finally {
sImpl.refresh(false);
if (target.hasNode("g")) {
target.getNode("g").remove();
sImpl.save();
}
}
}