directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r433061 - in /directory/trunks/shared/ldap/src: main/java/org/apache/directory/shared/ldap/name/RdnParser.java test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Date Sun, 20 Aug 2006 22:03:02 GMT
Author: elecharny
Date: Sun Aug 20 15:03:02 2006
New Revision: 433061

URL: http://svn.apache.org/viewvc?rev=433061&view=rev
Log:
Fixed a bug in parser and added a test in LdapDNTest :
when a DN contans more than one RDN, and when those RDNs
are OIDs and if we have a multi-atavs RDN, then the length
of the first RDN was not reset.

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java?rev=433061&r1=433060&r2=433061&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java
Sun Aug 20 15:03:02 2006
@@ -622,6 +622,7 @@
         StringTools.trimLeft( dn, pos );
 
         pos.end = pos.start;
+        pos.length = 0;
         
         if ( ( type = parseAttributeType( dn, pos ) ) == null )
         {

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=433061&r1=433060&r2=433061&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Sun Aug 20 15:03:02 2006
@@ -2638,4 +2638,17 @@
        Assert.assertEquals( "cn=Bush\\, Kate,dc=example,dc=com", name.getUpName() );
 
    }
+
+   
+   /**
+    * Added a test to check the parsing of a DN with more than one RDN
+    * which are OIDs, and with one RDN which has more than one atav.
+    * @throws NamingException
+    */
+   public void testDNWithMultiOidsRDN() throws NamingException
+   {
+       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() );
+   }
 }



Mime
View raw message