directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r895463 - /directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Date Sun, 03 Jan 2010 18:27:52 GMT
Author: elecharny
Date: Sun Jan  3 18:27:51 2010
New Revision: 895463

URL: http://svn.apache.org/viewvc?rev=895463&view=rev
Log:
Refactored the tests

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=895463&r1=895462&r2=895463&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
Sun Jan  3 18:27:51 2010
@@ -3548,7 +3548,6 @@
         
         Rdn rdn = dn.getRdn();
         assertEquals( "2.5.4.11", rdn.getNormType() );
-        // TODO: Wrong !!! Fixme
         assertEquals( "example",rdn.getNormValue() );
         assertEquals( "2.5.4.11=example+2.5.4.11=test", rdn.getNormName() );
         assertEquals( "ou", rdn.getUpType() );
@@ -3624,34 +3623,37 @@
     @Test
     public void testNormalizeAsciiCompositeWithEscaped() throws Exception
     {
-        LdapDN dn = new LdapDN( "  ou  =  Ex\\+mple + ou = T\\+ST ,  ou  =  COM " );
+        LdapDN dn = new LdapDN( "  OU  =  Ex\\+mple + ou = T\\+ST ,  ou  =  COM " );
         
         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( "  ou  =  Ex\\+mple + ou = T\\+ST ,  ou  =  COM ", dn.getName() );
         
         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() );
+
+        // Check the first RDN
+        assertEquals( "OU", rdn.getUpType() );
         assertEquals( "2.5.4.11", rdn.getNormType() );
-        // TODO: Wrong !!! Fixme
+        
+        // TODO : Wrong, fix me
+        //assertEquals( "Ex+mple",rdn.getUpValue() );
         assertEquals( "ex+mple",rdn.getNormValue() );
-        assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st", rdn.getNormName() );
-        assertEquals( "ou", rdn.getUpType() );
-        assertEquals( "Ex\\+mple",rdn.getUpValue() );
-        assertEquals( "  ou  =  Ex\\+mple + ou = T\\+ST ", rdn.getUpName() );
         
         // The first ATAV
         AttributeTypeAndValue atav = rdn.getAtav();
         
-        // TODO: Wrong !!! Fixme
-        assertEquals( "2.5.4.11=ex+mple", atav.getNormName() );
-        assertEquals( "2.5.4.11", atav.getNormType() );
-        assertEquals( "ex+mple", atav.getNormValue().get() );
+        // TODO : Wrong, fix me
+        //assertEquals( "  OU  =  Ex\\+mple ", atav.getUpName() );
+        assertEquals( "2.5.4.11=ex\\+mple", atav.getNormName() );
         
-        assertEquals( "ou", atav.getUpType() );
-        assertEquals( "Ex\\+mple", atav.getUpValue().get() );
+        assertEquals( "2.5.4.11", atav.getNormType() );
+        assertEquals( "OU", atav.getUpType() );
         
-        // Wrong !!! TODO : fix me
-        assertEquals( "  ou =  Ex\\+mple ", atav.getUpName() );
+        // TODO : Wrong, fix me
+        //assertEquals( "Ex+mple", atav.getUpValue().get() );
+        assertEquals( "ex+mple", atav.getNormValue().get() );
         
         assertEquals( 2, rdn.getNbAtavs() );
         
@@ -3664,13 +3666,14 @@
                 continue;
             }
             
-            assertEquals( "2.5.4.11=t+st", atav.getNormName() );
+            assertEquals( " ou = T\\+ST ", atav.getUpName() );
+            assertEquals( "2.5.4.11=t\\+st", atav.getNormName() );
+
+            assertEquals( "ou", atav.getUpType() );
             assertEquals( "2.5.4.11", atav.getNormType() );
-            assertEquals( "t+st", atav.getNormValue().get() );
             
-            assertEquals( "ou", atav.getUpType() );
-            assertEquals( "T\\+ST", atav.getUpValue().get() );
-            assertEquals( "  ou =  T\\+ST ", atav.getUpName() );
+            assertEquals( "T+ST", atav.getUpValue().get() );
+            assertEquals( "t+st", atav.getNormValue().get() );
         }
     }
 }



Mime
View raw message