| | |
| | | import org.opends.server.admin.std.server.UniqueAttributePluginCfg; |
| | | import org.opends.server.api.plugin.PluginType; |
| | | import org.opends.server.core.AddOperation; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.ModifyDNOperation; |
| | | import org.opends.server.core.ModifyOperation; |
| | | import org.forgerock.opendj.ldap.schema.AttributeType; |
| | | import org.opends.server.types.*; |
| | | import org.testng.annotations.*; |
| | | |
| | | import static org.opends.server.core.DirectoryServer.*; |
| | | import static org.opends.server.protocols.internal.InternalClientConnection.*; |
| | | import static org.opends.server.util.CollectionUtils.*; |
| | | import static org.testng.Assert.*; |
| | |
| | | deleteAttrsFromEntry(DN dn, String... attrTypeStrings) throws Exception { |
| | | LinkedList<Modification> mods = new LinkedList<>(); |
| | | for(String attrTypeString : attrTypeStrings) { |
| | | AttributeType attrType = getAttrType(attrTypeString); |
| | | AttributeType attrType = getAttributeType(attrTypeString); |
| | | mods.add(new Modification(ModificationType.DELETE, |
| | | Attributes.empty(attrType))); |
| | | } |
| | |
| | | * @param attrTypeString The attribute type string to remove. |
| | | */ |
| | | private void delAttribute(Entry entry, String attrTypeString) { |
| | | entry.removeAttribute(getAttrType(attrTypeString)); |
| | | entry.removeAttribute(getAttributeType(attrTypeString)); |
| | | } |
| | | |
| | | /** |
| | |
| | | Attributes.create(attrName, attrValues))); |
| | | } |
| | | |
| | | private AttributeType getAttrType(String attrTypeString) { |
| | | return DirectoryServer.getAttributeTypeOrDefault(attrTypeString); |
| | | } |
| | | |
| | | /** |
| | | * Perform modify operation with list of modifications. Expect return code |
| | | * of value rc. |