Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 77696 invoked from network); 27 Dec 2010 17:00:54 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Dec 2010 17:00:54 -0000 Received: (qmail 78179 invoked by uid 500); 27 Dec 2010 17:00:53 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 78111 invoked by uid 500); 27 Dec 2010 17:00:53 -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 78099 invoked by uid 99); 27 Dec 2010 17:00:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Dec 2010 17:00:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Mon, 27 Dec 2010 17:00:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3B2EF2388A2C; Mon, 27 Dec 2010 16:59:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1053108 - /directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryDeleteOperationIT.java Date: Mon, 27 Dec 2010 16:59:50 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101227165950.3B2EF2388A2C@eris.apache.org> Author: elecharny Date: Mon Dec 27 16:59:49 2010 New Revision: 1053108 URL: http://svn.apache.org/viewvc?rev=1053108&view=rev Log: Added a test, added some javadoc Modified: directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryDeleteOperationIT.java Modified: directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryDeleteOperationIT.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryDeleteOperationIT.java?rev=1053108&r1=1053107&r2=1053108&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryDeleteOperationIT.java (original) +++ directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryDeleteOperationIT.java Mon Dec 27 16:59:49 2010 @@ -84,7 +84,7 @@ public class SubentryDeleteOperationIT e // =================================================================== - // Test the Delete operation + // Test the Delete operation on APs // ------------------------------------------------------------------- // Failure expected // ------------------------------------------------------------------- @@ -133,6 +133,9 @@ public class SubentryDeleteOperationIT e } + /** + * Delete a SAP with a non admin user + */ @Test public void testDeleteSAPNonAdmin() throws Exception { @@ -163,6 +166,9 @@ public class SubentryDeleteOperationIT e // ------------------------------------------------------------------- // Success expected // ------------------------------------------------------------------- + /** + * Delete an AAP + */ @Test public void testDeleteAAP() throws Exception { @@ -190,6 +196,9 @@ public class SubentryDeleteOperationIT e } + /** + * Delete a SAP + */ @Test public void testDeleteSAP() throws Exception { @@ -215,10 +224,11 @@ public class SubentryDeleteOperationIT e assertNull( aap ); } - - + /** + * Delete an IAP + */ @Test public void testDeleteIAP() throws Exception { @@ -272,4 +282,49 @@ public class SubentryDeleteOperationIT e assertNull( sapDel ); } + + + // =================================================================== + // Test the Delete operation on subentries + // ------------------------------------------------------------------- + // Failure expected + // ------------------------------------------------------------------- + + // ------------------------------------------------------------------- + // Success expected + // ------------------------------------------------------------------- + /** + * Test the deletion of a subentry under an AAP + */ + @Test + public void testDeleteSubentryUnderAAP() throws Exception + { + // First add an AAP + Entry autonomousArea = LdifUtils.createEntry( + "ou=AAP1,ou=system", + "ObjectClass: top", + "ObjectClass: organizationalUnit", + "ou: AAP1", + "administrativeRole: autonomousArea" ); + + AddResponse response = adminConnection.add( autonomousArea ); + assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() ); + + // Add a subentry now + Entry subentry = LdifUtils.createEntry( + "cn=test,ou=AAP1,ou=system", + "ObjectClass: top", + "ObjectClass: subentry", + "ObjectClass: collectiveAttributeSubentry", + "cn: test", + "subtreeSpecification: {}", + "c-o: Test Org" ); + + response = adminConnection.add( subentry ); + assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() ); + + // Now delete it + DeleteResponse delResponse = adminConnection.delete( "cn=test,ou=AAP1,ou=system" ); + assertEquals( ResultCodeEnum.SUCCESS, delResponse.getLdapResult().getResultCode() ); + } }