mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Ludovic Poitou
07.14.2011 c51b4224b8fe6d4d4d2bdbb4cdf6c6e187627289
Fix Issue OPENDJ-113.
Missing an if statement for permissive control. Updated the test case to work.
Issue #OPENDJ-113 - Permissive Modify Control fails when deleting non existing attribute
2 files modified
11 ■■■■■ changed files
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java 7 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/core/ModifyOperationTestCase.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Copyright 2008-2011 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.server.workflowelement.localbackend;
@@ -1634,9 +1634,12 @@
    }
    else
    {
      throw new DirectoryException(ResultCode.NO_SUCH_ATTRIBUTE,
      if (! permissiveModify)
      {
        throw new DirectoryException(ResultCode.NO_SUCH_ATTRIBUTE,
                     ERR_MODIFY_DELETE_NO_SUCH_ATTR.get(
                          String.valueOf(entryDN), attr.getName()));
      }
    }
  }
opends/tests/unit-tests-testng/src/server/org/opends/server/core/ModifyOperationTestCase.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Copyright 2006-2011 Sun Microsystems, Inc.
 */
package org.opends.server.core;
@@ -4761,7 +4761,7 @@
                         entry.getOperationalAttributes());
    assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);
    LDAPAttribute attr = new LDAPAttribute("displayName");
    LDAPAttribute attr = new LDAPAttribute("description");
    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.DELETE, attr));