directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
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 GMT
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()
);
+    }
 }



Mime
View raw message