directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vte...@apache.org
Subject svn commit: r154437 - in incubator/directory/ldap/trunk/common/src: java/org/apache/ldap/common/name/LdapName.java test/org/apache/ldap/common/name/LdapNameTest.java
Date Sat, 19 Feb 2005 18:29:09 GMT
Author: vtence
Date: Sat Feb 19 10:29:07 2005
New Revision: 154437

URL: http://svn.apache.org/viewcvs?view=rev&rev=154437
Log:
Fixed DIRLDAP-35 : AttributeType comparison is now case insensitive

Modified:
    incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/LdapName.java
    incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java

Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/LdapName.java
URL: http://svn.apache.org/viewcvs/incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/LdapName.java?view=diff&r1=154436&r2=154437
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/LdapName.java
(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/LdapName.java
Sat Feb 19 10:29:07 2005
@@ -196,7 +196,7 @@
              */
             for ( int ii = 0; ii < l_min; ii++ ) 
             {
-                int l_comparison = get( ii ).compareTo( l_dn.get( ii ) ) ;
+                int l_comparison = get( ii ).compareToIgnoreCase( l_dn.get( ii ) ) ;
                 
                 if (  l_comparison != 0 )
                 {

Modified: incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
URL: http://svn.apache.org/viewcvs/incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java?view=diff&r1=154436&r2=154437
==============================================================================
--- incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
(original)
+++ incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
Sat Feb 19 10:29:07 2005
@@ -24,6 +24,7 @@
 import java.util.Collections ;
 
 import javax.naming.Name ;
+import javax.naming.NamingException;
 
 import junit.framework.TestCase ;
 
@@ -946,5 +947,13 @@
             m_parser.parse( "ou=People" ) ) ) ; 
         assertTrue( ! m_parser.parse( "ou=Groups" ).equals( 
             m_parser.parse( "ou=People" ) ) ) ; 
+    }
+
+   public void testAttributeTypeComparisonIsCaseInsensitive() throws NamingException
+    {
+        Name name1 = new LdapName("cn=HomeDir+cn=WorkDir");
+        Name name2 = new LdapName("cn=HomeDir+CN=WorkDir");
+
+        assertEquals( 0, name1.compareTo( name2 ) );
     }
 }



Mime
View raw message