directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r453266 - in /directory/branches/shared/0.9.5/ldap/src: main/java/org/apache/directory/shared/ldap/name/LdapDN.java test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Date Thu, 05 Oct 2006 15:23:07 GMT
Author: akarasulu
Date: Thu Oct  5 08:23:07 2006
New Revision: 453266

URL: http://svn.apache.org/viewvc?view=rev&rev=453266
Log:
fixing bug in LdapDN.addAll() when using a CompoundName which in turn causes LDIF loader problems

Modified:
    directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
    directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java?view=diff&rev=453266&r1=453265&r2=453266
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
Thu Oct  5 08:23:07 2006
@@ -984,7 +984,7 @@
                return this;
            }
 
-           for ( int ii = 0; ii < name.size(); ii++ )
+           for ( int ii = name.size() - 1; ii >= 0; ii-- )
            {
                Rdn rdn = new Rdn( name.get( ii ) );
                rdns.add( size() - posn, rdn );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?view=diff&rev=453266&r1=453265&r2=453266
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Thu Oct  5 08:23:07 2006
@@ -34,7 +34,9 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
+import javax.naming.CompoundName;
 import javax.naming.InvalidNameException;
 import javax.naming.Name;
 import javax.naming.NamingException;
@@ -2651,5 +2653,18 @@
        LdapDN name = new LdapDN( "0.9.2342.19200300.100.1.1=00123456789+2.5.4.3=pablo picasso,2.5.4.11=search,2.5.4.10=imc,2.5.4.6=us"
);
        Assert.assertEquals( "0.9.2342.19200300.100.1.1=00123456789+2.5.4.3=pablo picasso,2.5.4.11=search,2.5.4.10=imc,2.5.4.6=us",
name.toString() );
        Assert.assertEquals( "0.9.2342.19200300.100.1.1=00123456789+2.5.4.3=pablo picasso,2.5.4.11=search,2.5.4.10=imc,2.5.4.6=us",
name.getUpName() );
+   }
+   
+   public void testAddAllWithCompositeName() throws NamingException
+   {
+       Properties props = new Properties();
+       props.setProperty( "jndi.syntax.direction", "right_to_left" );
+       props.setProperty( "jndi.syntax.separator", "," );
+       props.setProperty( "jndi.syntax.ignorecase", "true" );
+       props.setProperty( "jndi.syntax.trimblanks", "true" );
+       Name compoundName = new CompoundName( "ou=Users,ou=Conference", props );
+       LdapDN dn = new LdapDN();
+       dn.addAll( compoundName );
+       System.out.println( dn.toString() );
    }
 }



Mime
View raw message