You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by py...@apache.org on 2007/05/15 05:44:41 UTC
svn commit: r538049 - in /harmony/enhanced/classlib/trunk/modules/jndi/src:
main/java/javax/naming/ldap/LdapName.java
test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java
Author: pyang
Date: Mon May 14 20:44:36 2007
New Revision: 538049
URL: http://svn.apache.org/viewvc?view=rev&rev=538049
Log:
Apply patch for HARMONY-3859([classlib][jndi] Method remove(int) of LdapName will throw exception when cast the return object to String)
Modified:
harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java
harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java?view=diff&rev=538049&r1=538048&r2=538049
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java Mon May 14 20:44:36 2007
@@ -322,7 +322,7 @@
* @ar.org.fitc.spec_ref
*/
public Object remove(int posn) throws InvalidNameException {
- return rdns.remove(posn);
+ return rdns.remove(posn).toString();
}
/**
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java?view=diff&rev=538049&r1=538048&r2=538049
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java Mon May 14 20:44:36 2007
@@ -3275,6 +3275,23 @@
/**
* <p>
+ * Test method for 'javax.naming.ldap.LdapName.remove(int)'
+ * </p>
+ * <p>
+ * Here we are testing if this method removes a component from this LDAP
+ * name.
+ * </p>
+ * <p>
+ * The expected result is an index out of boundary exception.
+ * </p>
+ */
+ public void testRemove006() throws Exception {
+ LdapName ln = new LdapName("t=test, t1=test1");
+ assertEquals("t=test", (String)ln.remove(1));
+ }
+
+ /**
+ * <p>
* Test method for 'javax.naming.ldap.LdapName.getRdns()'
* </p>
* <p>