Index: modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/RdnTest.java =================================================================== --- modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/RdnTest.java (revision 538566) +++ modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/RdnTest.java (working copy) @@ -1709,6 +1709,23 @@ /** *
+ * Test method for 'javax.naming.ldap.Rdn.size()' + *
+ *+ * Here we are testing if the return of this method is the correct size of + * the given Rdn wich has three names. + *
+ *+ * The expected result is an integer with the value of three. + *
+ */ + public void testSize004() throws Exception { + Rdn rdn = new Rdn("t = #20 "); + assertEquals(1, rdn.size()); + } + + /** + ** Test method for 'javax.naming.ldap.Rdn.escapeValue(Object)' *
*Index: modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/RelaxedDnParser.java =================================================================== --- modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/RelaxedDnParser.java (revision 538566) +++ modules/jndi/src/main/java/org/apache/harmony/jndi/internal/parser/RelaxedDnParser.java (working copy) @@ -92,6 +92,10 @@ } pos++; } + + while (end > beg+1 && chars[end - 1] == ' ') { + end--; + } // verify length of hex string // encoded byte array must be even number