directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vte...@apache.org
Subject svn commit: r154446 - 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 19:26:18 GMT
Author: vtence
Date: Sat Feb 19 11:26:17 2005
New Revision: 154446

URL: http://svn.apache.org/viewcvs?view=rev&rev=154446
Log:
Reverted previous commit and added test case for attribute value comparison

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=154445&r2=154446
==============================================================================
--- 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 11:26:17 2005
@@ -27,22 +27,21 @@
 package org.apache.ldap.common.name ;
 
 
-import javax.naming.Name ;
-import javax.naming.NamingException ;
-import javax.naming.InvalidNameException ;
-
-import java.io.IOException;
-import java.util.List ;
-import java.util.Iterator ;
-import java.util.ArrayList ;
-import java.util.Enumeration ;
-import java.util.NoSuchElementException ;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
 
 
 /**
  * A distinguished name implementation for LDAPv3.
  *
  * @todo Get the RFC for DN syntax into this javadoc
+ *
  * @todo Think about adding a printSuffix(int) method to avoid Name creation
  *
  * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
@@ -196,7 +195,7 @@
              */
             for ( int ii = 0; ii < l_min; ii++ ) 
             {
-                int l_comparison = get( ii ).compareToIgnoreCase( l_dn.get( ii ) ) ;
+                int l_comparison = get( ii ).compareTo( l_dn.get( ii ) ) ;
                 
                 if (  l_comparison != 0 )
                 {
@@ -228,7 +227,6 @@
                 + "to is not a valid LDAP distinguished name." ) ;
         }
     }
-
 
     /**
      * Returns the number of components in this name.

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=154445&r2=154446
==============================================================================
--- 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 11:26:17 2005
@@ -949,11 +949,28 @@
             m_parser.parse( "ou=People" ) ) ) ; 
     }
 
-   public void testAttributeTypeComparisonIsCaseInsensitive() throws NamingException
+    public void testAttributeValueComparisonIsCaseSensitive() throws Exception
     {
-        Name name1 = new LdapName("cn=HomeDir+cn=WorkDir");
-        Name name2 = new LdapName("cn=HomeDir+CN=WorkDir");
+        Name name1 = new LdapName( "cn=HomeDir" );
+        Name name2 = new LdapName( "cn=homedir" );
 
-        assertEquals( 0, name1.compareTo( name2 ) );
+        assertTrue( name1.compareTo( name2 ) < 0 );
     }
+
+//   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 ) );
+//    }
+//
+//    public void testNameComparisonIsInsensitiveToAttributesOrder() throws NamingException
+//     {
+//
+//         Name name1 = new LdapName( "cn=HomeDir+cn=WorkDir" );
+//         Name name2 = new LdapName( "cn=WorkDir+cn=HomeDir" );
+//
+//         assertEquals( 0, name1.compareTo( name2 ) );
+//     }
 }



Mime
View raw message