directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r358154 - /directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/LdapDNTest.java
Date Tue, 20 Dec 2005 23:55:04 GMT
Author: elecharny
Date: Tue Dec 20 15:54:59 2005
New Revision: 358154

URL: http://svn.apache.org/viewcvs?rev=358154&view=rev
Log:
Changed the way OID container is initialized in last two tests

Modified:
    directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/LdapDNTest.java

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/LdapDNTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/LdapDNTest.java?rev=358154&r1=358153&r2=358154&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/LdapDNTest.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/LdapDNTest.java
Tue Dec 20 15:54:59 2005
@@ -33,6 +33,8 @@
 import org.apache.asn1.codec.DecoderException;
 import org.apache.ldap.common.name.DNParser;
 import org.apache.ldap.common.name.LdapDN;
+import org.apache.ldap.common.schema.DeepTrimToLowerNormalizer;
+import org.apache.ldap.common.schema.OidNormalizer;
 
 /**
  * Test the class LdapDN
@@ -1970,20 +1972,21 @@
     public void testLdapNameToOid() throws Exception
     {
         ArrayList list = new ArrayList() ;
-        list.add( "ou=People" ) ;
-        list.add( "dc=example" ) ;
-        list.add( "dc=com" ) ;
+        list.add( "ou= Some   People   " ) ;
+        list.add( "dc = eXample" ) ;
+        list.add( "dc= cOm" ) ;
         Name name = new LdapDN( list.iterator() ) ;
         
         Map oids = new HashMap();
         
-        oids.put( "dc", "0.9.2342.19200300.100.1.25" );
-        oids.put( "ou", "2.5.4.11" );
+        oids.put( "dc", new OidNormalizer( "0.9.2342.19200300.100.1.25", new  DeepTrimToLowerNormalizer()
) );
+        oids.put( "ou", new OidNormalizer( "2.5.4.11", new  DeepTrimToLowerNormalizer() )
);
         
         Name result = LdapDN.toOidName( name, oids );
         
         assertTrue( result.toString().equals( 
-            "2.5.4.11=People,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com"
) ) ;
+            "2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com"
) ) ;
+        assertTrue( ( (LdapDN)result).toUpName().equals( "ou= Some   People   ,dc = eXample,dc=
cOm" ) );
     }
 
     /**
@@ -1995,8 +1998,8 @@
         
         Map oids = new HashMap();
         
-        oids.put( "dc", "0.9.2342.19200300.100.1.25" );
-        oids.put( "ou", "2.5.4.11" );
+        oids.put( "dc", new OidNormalizer( "0.9.2342.19200300.100.1.25", new  DeepTrimToLowerNormalizer()
) );
+        oids.put( "ou", new OidNormalizer( "2.5.4.11", new  DeepTrimToLowerNormalizer() )
);
         
         Name result = LdapDN.toOidName( name, oids );
         assertTrue( result.toString().equals( "" ) ) ;



Mime
View raw message