directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1329194 - /directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
Date Mon, 23 Apr 2012 11:50:49 GMT
Author: kayyagari
Date: Mon Apr 23 11:50:49 2012
New Revision: 1329194

URL: http://svn.apache.org/viewvc?rev=1329194&view=rev
Log:
test for DIRAPI-84

Modified:
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java?rev=1329194&r1=1329193&r2=1329194&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAddRequestTest.java
Mon Apr 23 11:50:49 2012
@@ -47,6 +47,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapNoPermissionException;
+import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
@@ -56,6 +57,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.util.DateUtils;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -347,4 +349,31 @@ public class ClientAddRequestTest extend
         
         assertEquals( 2, count );
     }
+    
+    /**
+     * the below test fails cause the API is failing to
+     * preserve the UP name of the attribute of RDN
+     * when the DN is schema-aware
+     */
+    @Test
+    @Ignore("see DIRAPI-84")
+    public void testPreserveRdnUpName() throws Exception
+    {
+        Dn dn = new Dn( getService().getSchemaManager(), "cn=testadd,ou=system" );
+        Entry entry = new DefaultEntry( dn );
+        entry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.PERSON_OC );
+        entry.add( SchemaConstants.CN_AT, "testadd" );
+        entry.add( SchemaConstants.SN_AT, "testadd_sn" );
+
+        connection.add( entry );
+
+        assertTrue( session.exists( dn ) );
+
+        entry = connection.lookup(dn);
+        
+        String ldif = LdifUtils.convertToLdif(entry);
+        
+        assertTrue( ldif.contains(dn.getName()) );
+    }
+    
 }



Mime
View raw message