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

Reply via email to