directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <directory-...@incubator.apache.org>
Subject [jira] Commented: (DIRLDAP-35) LdapName comparison must be case-insensitive for attibutType
Date Sun, 06 Feb 2005 00:11:27 GMT
     [ http://issues.apache.org/jira/browse/DIRLDAP-35?page=comments#action_58631 ]
     
Emmanuel Lecharny commented on DIRLDAP-35:
------------------------------------------

Two test case to illustrate the problem (class org.apache.ldap.common.name.LdapNameTest) :

    /**
     * Test the equivalence of two DNs, attributeType are not case sensitive
     * They MUST be equals.
     *
     * @throws  NamingException  if anything goes wrong.
     */
    public void testInsensitiveTypeAttribut() throws NamingException
    {

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

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

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

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

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



> LdapName comparison must be case-insensitive for attibutType
> ------------------------------------------------------------
>
>          Key: DIRLDAP-35
>          URL: http://issues.apache.org/jira/browse/DIRLDAP-35
>      Project: Directory LDAP
>         Type: Bug
>   Components: Common
>     Reporter: Emmanuel Lecharny
>     Assignee: Alex Karasulu

>
> While comparing two DNs, the AttributeType of each RDN must be compared in a case-insensitive
way : RFC 2251, chap. 4.1.4, par.4.
> It could be tricky to perform a valid comparison :
> A=V1+B=V2,C=GB and A=V1+b=V2,C=GB are equals in regards with the RFC,
> A=V1+B=V2,C=GB and A=V1+C=V2,C=GB are differents in regards with the RFC.
> LdapName.compareTo function does not return a valid result :
>         Name n1 = new DnParser().parse("A=V");
>         Name n2 = new DnParser().parse("a=V");
>         int val = n1.compareTo(n2);  // val = 0xffffffe0 instead of 0

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message