Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20F6768C0 for ; Sun, 22 May 2011 11:24:31 +0000 (UTC) Received: (qmail 57811 invoked by uid 500); 22 May 2011 11:24:31 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 57774 invoked by uid 500); 22 May 2011 11:24:31 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 57766 invoked by uid 99); 22 May 2011 11:24:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 May 2011 11:24:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 May 2011 11:24:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BE2BB2388901; Sun, 22 May 2011 11:24:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: kayyagari@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110522112407.BE2BB2388901@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 {