directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <seelm...@apache.org>
Subject Re: svn commit: r891807 - in /directory/shared/branches/shared-schema/ldap/src: main/java/org/apache/directory/shared/ldap/name/Rdn.java test/java/org/apache/directory/shared/ldap/name/RdnTest.java
Date Thu, 17 Dec 2009 19:11:34 GMT
Hi,
> +    @Test
> +    public void testRDNCreation() throws InvalidNameException
> +    {
> +        Rdn rdn = new Rdn( "A", "  b  " );
> +        assertEquals( "a=\\  b \\ ", rdn.getNormName() );
> +        assertEquals( "A=  b  ", rdn.getUpName() );
> +    }
>   
IMO this test is wrong. The UpName should be "A=\\ b \\ ". Leading and 
trailing spaces in the AttributeValue must be escaped when converting it 
to a String, see RFC 4514 Section 2.4.

Otherwise when parsing this UpName
  Rdn rdn = new Rdn( "A=  b  " );
all the spaces would be removed and the resulting AttributeValue would 
be just "b".

Kind Regards,
Stefan


Mime
View raw message