directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r431164 - 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 test/java/org/apache/directory/shared/ldap/name/RdnTest.java
Date Sun, 13 Aug 2006 11:43:06 GMT
Author: elecharny
Date: Sun Aug 13 04:43:05 2006
New Revision: 431164

URL: http://svn.apache.org/viewvc?rev=431164&view=rev
Log:
Fixed DIRSERVER_703. The upName was computed too early in the process, I just 
moved one line down in the parser (not totally randomly :)

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
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.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=431164&r1=431163&r2=431164&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 13 04:43:05 2006
@@ -656,7 +656,6 @@
         if ( rdn != null )
         {
             rdn.addAttributeTypeAndValue( type, value );
-            rdn.setUpName( dn.substring( start, pos.end )  );
             rdn.normalizeString();
             
             pos.start = pos.end;
@@ -665,6 +664,7 @@
 
         parseNameComponents( dn, pos, rdn );
         
+        rdn.setUpName( dn.substring( start, pos.end )  );
         pos.start = pos.end;
         return DNUtils.PARSING_OK;
     }

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=431164&r1=431163&r2=431164&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 13 04:43:05 2006
@@ -173,6 +173,20 @@
         Assert.assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getUpName() );
     }
 
+    
+    /**
+    * Test to see if a DN with multiRdn values is preserved after an addAll.
+    */
+    public void testAddAllWithMultivaluedAttribute() throws InvalidNameException
+    {
+    	LdapDN dn = new LdapDN( "cn=Kate Bush+sn=Bush,ou=system" );
+        LdapDN target = new LdapDN();
+        target.addAll( target.size(), dn );
+        assertEquals( "cn=Kate Bush+sn=Bush,ou=system", target.toString() );
+        System.out.println( target.getUpName() );
+        assertEquals( "cn=Kate Bush+sn=Bush,ou=system", target.getUpName() );
+    }
+        
 
     /**
      * test a simple DN with an oid prefix (uppercase) : OID.12.34.56 = azerty

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java?rev=431164&r1=431163&r2=431164&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
Sun Aug 13 04:43:05 2006
@@ -491,4 +491,10 @@
         Assert.assertEquals( "\\\\\\00-\\+\\#\\7F-", res );
     }
 
+ 
+    public void testDIRSERVER_703() throws InvalidNameException 
+    {
+    	Rdn rdn = new Rdn( "cn=Kate Bush+sn=Bush" );
+    	assertEquals( "cn=Kate Bush+sn=Bush", rdn.getUpName() );
+	}
 }



Mime
View raw message