Issue Details (XML | Word | Printable)

Key: DIRSERVER-202
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Alex Karasulu
Reporter: Emmanuel Lecharny
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Order of multi-valued RDN should not matters while comparing

Created: 06/Feb/05 09:08 AM   Updated: 24/Jun/06 08:55 PM
Return to search
Component/s: ldap
Affects Version/s: pre-1.0
Fix Version/s: pre-1.0

Time Tracking:
Not Specified

Resolution Date: 12/Aug/05 11:01 AM


 Description  « Hide
class org.apache.ldap.common.name.LdapName, method compareTo should return 0 if we compare two RDN which contains multi-valued attributes like :

cn=test+cn=result

must be equals to

cn=result+cn=test

This is not the case. Here is a test case (to be added to class org.apache.ldap.common.name.LdapNameTest) :

    /**
     * Test the equivalence of two DNs with multi-valued RDN. AttributeType are
     * not case sensitive. Each attribute type MUST be compared. Order MUST not
     * matters They MUST be equals.
     *
     * @throws NamingException if anything goes wrong.
     */
    public void testInsensitiveTypeMultiValuedAttributNotOrdered() throws NamingException
    {

        Name name1 = new LdapName("cn=HomeDir+cn=WorkDir");
        Name name2 = new LdapName("cn=WorkDir+cn=HomeDir");

        assertEquals(name1.compareTo(name2), 0);
    }



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #232182 Fri Aug 12 02:00:22 UTC 2005 akarasulu changes ...

 o added test case for DnParser with illegal expression to show it does not
   accept junk this was for Emmanuels test case, DIRLDAP-39 here:
        http://issues.apache.org/jira/browse/DIRLDAP-39
 o added some utility methods for dealing with composite name components
   which concatentate several attribute value pairs to form a name component
   using the '+'
 o added test cases for compareTo which corrects the bugs in DIRLDAP-36 here:
        http://issues.apache.org/jira/browse/DIRLDAP-36
 o also added corrective code to the equals() method which had the same issues
   as the compareTo() method
Files Changed
MODIFY /directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
MODIFY /directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/name/LdapName.java
MODIFY /directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/util/NamespaceToolsTest.java
MODIFY /directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java
MODIFY /directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/util/NamespaceTools.java

Alex Karasulu made changes - 12/Aug/05 06:46 AM
Field Original Value New Value
Fix Version/s 0.9.2 [ 12310220 ]
Alex Karasulu made changes - 12/Aug/05 07:56 AM
Status Open [ 1 ] In Progress [ 3 ]
Alex Karasulu added a comment - 12/Aug/05 11:01 AM

Alex Karasulu made changes - 12/Aug/05 11:01 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Alex Karasulu made changes - 07/Feb/06 02:41 PM
Project Directory LDAP [ 10514 ] ApacheDS [ 12310260 ]
Affects Version/s pre-1.0 [ 12310782 ]
Key DIRLDAP-36 DIRSERVER-202
Fix Version/s pre-1.0 [ 12310782 ]
Fix Version/s 0.9.2 [ 12310220 ]
Component/s ldap [ 12310715 ]
Emmanuel Lecharny added a comment - 24/Jun/06 08:55 PM
done

Emmanuel Lecharny made changes - 24/Jun/06 08:55 PM
Status Resolved [ 5 ] Closed [ 6 ]