directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r521996 - /directory/shared/branches/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Date Sat, 24 Mar 2007 09:01:18 GMT
Author: elecharny
Date: Sat Mar 24 02:01:17 2007
New Revision: 521996

URL: http://svn.apache.org/viewvc?view=rev&rev=521996
Log:
Remove calls to Integer.valueOf( int) (not available in jdk 1.4)
Replaced the javax.naming.LdapName import by the com.sun.jndi.ldap.LdapName import
Replaced the use of LdapName with ", the sun version of LdapName does not handle correctly
them.

Modified:
    directory/shared/branches/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java

Modified: directory/shared/branches/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?view=diff&rev=521996&r1=521995&r2=521996
==============================================================================
--- directory/shared/branches/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/shared/branches/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Sat Mar 24 02:01:17 2007
@@ -40,7 +40,6 @@
 import javax.naming.InvalidNameException;
 import javax.naming.Name;
 import javax.naming.NamingException;
-import javax.naming.ldap.LdapName;
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
@@ -53,6 +52,8 @@
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 
+import com.sun.jndi.ldap.LdapName;
+
 
 /**
  * Test the class LdapDN
@@ -2329,7 +2330,7 @@
     */
    public void testName() throws NamingException
    {
-       Name jName = new javax.naming.ldap.LdapName("cn=four,cn=three,cn=two,cn=one");
+       Name jName = new LdapName("cn=four,cn=three,cn=two,cn=one");
        Name aName = new LdapDN("cn=four,cn=three,cn=two,cn=one");
        assertEquals(jName.toString(), "cn=four,cn=three,cn=two,cn=one");
        assertEquals(aName.toString(), "cn=four,cn=three,cn=two,cn=one");
@@ -2503,16 +2504,19 @@
    public void testDoubleQuoteInNameDIRSERVER_642() throws NamingException
    {
        Name name1 = new LdapDN( "cn=\"Kylie Minogue\",dc=example,dc=com" );
-       Name name2 = new LdapName( "cn=\"Kylie Minogue\",dc=example,dc=com" );
+       
+       String[] rdns = new String[] { "dc=com", "dc=example", "cn=Kylie Minogue" };
 
-       Enumeration j = name1.getAll();
-       Enumeration a = name2.getAll();
+       Enumeration a = name1.getAll();
+       int i = 0;
 
-       while (j.hasMoreElements())
+       while (a.hasMoreElements())
        {
-           assertTrue(j.hasMoreElements());
-           assertEquals(j.nextElement(), a.nextElement());
+           assertTrue(a.hasMoreElements());
+           assertEquals(rdns[i++], a.nextElement());
        }
+       
+       // com.sun.jndi.ldap.LdapName has a bug: it can't 
    }
 
    /**



Mime
View raw message