directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r895717 - /directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Date Mon, 04 Jan 2010 17:31:14 GMT
Author: elecharny
Date: Mon Jan  4 17:31:12 2010
New Revision: 895717

URL: http://svn.apache.org/viewvc?rev=895717&view=rev
Log:
Fixed some failing tests which were not normalizing DNs

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

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=895717&r1=895716&r2=895717&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Mon Jan  4 17:31:12 2010
@@ -3443,28 +3443,32 @@
     public void testTrailingEscapedSpace() throws Exception
     {
         LdapDN dn1 = new LdapDN( "ou=A\\ ,ou=system" );
+        dn1.normalize( oids );
         assertEquals( "ou=A\\ ,ou=system", dn1.getName() );
-        assertEquals( "ou=A ,ou=system", dn1.getNormName() );
-        assertEquals( "ou=A ", dn1.getRdn().getUpName() );
-        assertEquals( "ou=A ", dn1.getRdn().getNormName() );
+        assertEquals( "ou=a,ou=system", dn1.getNormName() );
+        assertEquals( "ou=A\\ ", dn1.getRdn().getUpName() );
+        assertEquals( "ou=a", dn1.getRdn().getNormName() );
 
         LdapDN dn2 = new LdapDN( "ou=A\\20,ou=system" );
+        dn2.normalize( oids );
         assertEquals( "ou=A\\20,ou=system", dn2.getName() );
-        assertEquals( "ou=A\\ ,ou=system", dn2.getNormName() );
+        assertEquals( "ou=a,ou=system", dn2.getNormName() );
         assertEquals( "ou=A\\20", dn2.getRdn().getUpName() );
-        assertEquals( "ou=A\\ ", dn2.getRdn().getNormName() );
+        assertEquals( "ou=a", dn2.getRdn().getNormName() );
         
         LdapDN dn3 = new LdapDN( "ou=\\ ,ou=system" );
+        dn3.normalize( oids );
         assertEquals( "ou=\\ ,ou=system", dn3.getName() );
-        assertEquals( "ou=\\ ,ou=system", dn3.getNormName() );
+        assertEquals( "ou=,ou=system", dn3.getNormName() );
         assertEquals( "ou=\\ ", dn3.getRdn().getUpName() );
-        assertEquals( "ou=\\ ", dn3.getRdn().getNormName() );
+        assertEquals( "ou=", dn3.getRdn().getNormName() );
         
         LdapDN dn4 = new LdapDN( "ou=\\20,ou=system" );
+        dn4.normalize( oids );
         assertEquals( "ou=\\20,ou=system", dn4.getName() );
-        assertEquals( "ou=\\ ,ou=system", dn4.getNormName() );
+        assertEquals( "ou=,ou=system", dn4.getNormName() );
         assertEquals( "ou=\\20", dn4.getRdn().getUpName() );
-        assertEquals( "ou=\\ ", dn4.getRdn().getNormName() );
+        assertEquals( "ou=", dn4.getRdn().getNormName() );
     }
 
 
@@ -3563,7 +3567,7 @@
         assertEquals( "ou", atav.getUpType() );
         assertEquals( "Example", atav.getUpValue().get() );
         
-        assertEquals( "ou  =  Example ", atav.getUpName() );
+        assertEquals( "  ou  =  Example ", atav.getUpName() );
         
         assertEquals( 2, rdn.getNbAtavs() );
         
@@ -3676,12 +3680,12 @@
         dn.normalize( oidOids );
         
         assertEquals( "  OU  =  Ex\\+mple + ou = T\\+ST\\  ,  ou  =  COM ", dn.getName()
);
-        assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st\\ ,2.5.4.11=com", dn.getNormName()
);
+        assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st,2.5.4.11=com", dn.getNormName()
);
         
         // Check the first RDN
         rdn = dn.getRdn();
         assertEquals( "  OU  =  Ex\\+mple + ou = T\\+ST\\  ", rdn.getUpName() );
-        assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st\\ ", rdn.getNormName() );
+        assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st", rdn.getNormName() );
 
         assertEquals( "OU", rdn.getUpType() );
         assertEquals( "2.5.4.11", rdn.getNormType() );
@@ -3713,13 +3717,13 @@
             }
             
             assertEquals( " ou = T\\+ST\\  ", ava.getUpName() );
-            assertEquals( "2.5.4.11=t\\+st\\ ", ava.getNormName() );
+            assertEquals( "2.5.4.11=t\\+st", ava.getNormName() );
 
             assertEquals( "ou", ava.getUpType() );
             assertEquals( "2.5.4.11", ava.getNormType() );
             
             assertEquals( "T+ST ", ava.getUpValue().get() );
-            assertEquals( "t+st ", ava.getNormValue().get() );
+            assertEquals( "t+st", ava.getNormValue().get() );
         }
     }
 }



Mime
View raw message