On Wed, May 27, 2015 at 5:15 PM, Radovan Semancik < radovan.seman...@evolveum.com> wrote:
> Hi, > > Oh yes. You are right. Sorry for that. Thanks for pointing this out. Fixed > in rev.1681938. > > The strange thing is that I have run all the API tests before committing. > I'm sure about this. And the tests haven't failed. I had run "mvn clean > install" with the trunk of "shared" before the fix. And again no failure. my guess is that this case is not covered by the existing tests, probably due to identical input for newDn and entryDn > Some tests are obviously executed during "clean install". Should I somehow > run other tests explicitly? (other project? or a different profile?) > the best is to add a new test or pickup a related existing test and modify to cover this case > > -- > > Radovan Semancik > Software Architect > evolveum.com > > > > On 05/27/2015 07:55 AM, Stefan Seelmann wrote: > >> On 05/26/2015 02:10 PM, seman...@apache.org wrote: >> >>> Author: semancik >>> Date: Tue May 26 12:10:25 2015 >>> New Revision: 1681745 >>> >>> URL: http://svn.apache.org/r1681745 >>> Log: >>> Check if we really need to specify newSuperior in moveAndRename(...) >>> newSuperior is optional [RFC4511, section 4.9]. Some servers (e.g. >>> OpenDJ 2.6) require a special privilege if >>> newSuperior is specified even if it is the same as the old one. >>> Therefore let's not specify it if we do not need it. >>> This is better interoperability. >>> >>> Modified: >>> >>> >>> directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java >>> >>> Modified: >>> directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java >>> URL: >>> http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1681745&r1=1681744&r2=1681745&view=diff >>> >>> ============================================================================== >>> --- >>> directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java >>> (original) >>> +++ >>> directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java >>> Tue May 26 12:10:25 2015 >>> @@ -2625,7 +2625,18 @@ public class LdapNetworkConnection exten >>> ModifyDnRequest modDnRequest = new ModifyDnRequestImpl(); >>> modDnRequest.setName( entryDn ); >>> modDnRequest.setNewRdn( newDn.getRdn() ); >>> - modDnRequest.setNewSuperior( newDn.getParent() ); >>> + >>> + // Check if we really need to specify newSuperior. >>> + // newSuperior is optional [RFC4511, section 4.9] >>> + // Some servers (e.g. OpenDJ 2.6) require a special privilege if >>> + // newSuperior is specified even if it is the same as the old >>> one. Therefore let's not >>> + // specify it if we do not need it. This is better >>> interoperability. >>> + Dn newDnParent = entryDn.getParent(); >>> >> I think this should be >> >> Dn newDnParent = newDn.getParent(); >> >> + if ( newDnParent != null && !newDnParent.equals( >>> newDn.getParent() ) ) >>> >> And here: >> >> if ( newDnParent != null && !newDnParent.equals( entryDn.getParent() >> ) ) >> >> + { >>> + modDnRequest.setNewSuperior( newDnParent ); >>> + } >>> + >>> >> Otherwise the old parent is used. See also test failures on Jenkins: >> https://builds.apache.org/job/dir-apacheds-ubuntu-deploy/1718/ >> >> modDnRequest.setDeleteOldRdn( deleteOldRdn ); >>> ModifyDnResponse modifyDnResponse = modifyDn( modDnRequest ); >>> >>> >>> > > -- Kiran Ayyagari http://keydap.com