directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1125912 - /directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
Date Sun, 22 May 2011 11:24:07 GMT
Author: kayyagari
Date: Sun May 22 11:24:07 2011
New Revision: 1125912

URL: http://svn.apache.org/viewvc?rev=1125912&view=rev
Log:
o added a test for moveAndRename operation (DIRSERVER-1579)

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

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java?rev=1125912&r1=1125911&r2=1125912&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyDnRequestTest.java
Sun May 22 11:24:07 2011
@@ -36,6 +36,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.client.api.LdapApiIntegrationUtils;
+import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
@@ -115,7 +117,30 @@ public class ClientModifyDnRequestTest e
         assertTrue( session.exists( new Dn( "cn=modDn,ou=users,ou=system" ) ) );
     }
 
+    
+    @Test
+    public void testMoveAndRename() throws Exception
+    {
+        Dn origDn = new Dn( "cn=testadd,ou=users,ou=system" );
+        Entry entry = new DefaultEntry( origDn );
+        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 );
+        
+        Dn newDn = new Dn( "cn=testaddMovedAndRenamed,ou=system" );
+        connection.moveAndRename( origDn, newDn );
+
+        assertFalse( session.exists( origDn ) );
+
+        entry = session.lookup( newDn, "+" );
+
+        assertTrue( entry.containsAttribute( SchemaConstants.MODIFIERS_NAME_AT ) );
+        assertTrue( entry.containsAttribute( SchemaConstants.MODIFY_TIMESTAMP_AT ) );
+    }
 
+    
     @Test
     public void testModifyDnAsync() throws Exception
     {



Mime
View raw message