directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1052410 - in /directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core: admin/ subtree/SubentryAddOperationIT.java
Date Thu, 23 Dec 2010 23:16:50 GMT
Author: elecharny
Date: Thu Dec 23 23:16:50 2010
New Revision: 1052410

URL: http://svn.apache.org/viewvc?rev=1052410&view=rev
Log:
o Moved the test to Subentry
o Added some tests for the Add operation

Added:
    directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java
      - copied, changed from r1052347, directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java
Removed:
    directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/admin/

Copied: directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java
(from r1052347, directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java?p2=directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java&p1=directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java&r1=1052347&r2=1052410&rev=1052410&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java
(original)
+++ directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java
Thu Dec 23 23:16:50 2010
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.server.core.admin;
+package org.apache.directory.server.core.subtree;
 
 
 import static org.junit.Assert.assertEquals;
@@ -31,20 +31,13 @@ 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.server.core.integ.IntegrationUtils;
-import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
-import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.message.AddResponse;
-import org.apache.directory.shared.ldap.message.ModifyDnResponse;
-import org.apache.directory.shared.ldap.message.ModifyResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -66,7 +59,7 @@ import org.junit.runner.RunWith;
         "sn: test",
         "userpassword: test"
     })
-public class AdministrativePointServiceIT extends AbstractLdapTestUnit
+public class SubentryAddOperationIT extends AbstractLdapTestUnit
 {
     // The shared LDAP admin connection
     private static LdapConnection adminConnection;
@@ -102,7 +95,7 @@ public class AdministrativePointServiceI
 
 
     // ===================================================================
-    // Test the Add operation
+    // Test the Add operation for APs
     // -------------------------------------------------------------------
     // Failure expected
     // -------------------------------------------------------------------
@@ -187,6 +180,94 @@ public class AdministrativePointServiceI
     
     
     /**
+     * Test the addition of an SAP with the same IAP (AccessControl)
+     */
+    @Test
+    public void testAddIAPWithSAPAccessControl() throws Exception
+    {
+        Entry sapiap = LdifUtils.createEntry( 
+            "ou=SAP-IAP,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: SAP-IAP", 
+            "administrativeRole: accessControlInnerArea",
+            "administrativeRole: accessControlSpecificArea"
+            );
+
+        // It should fail
+        AddResponse response = adminConnection.add( sapiap );
+
+        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
+    }
+    
+    
+    /**
+     * Test the addition of an SAP with the same IAP (CollectiveAttribute)
+     */
+    @Test
+    public void testAddIAPWithSAPCollectiveAttribute() throws Exception
+    {
+        Entry sapiap = LdifUtils.createEntry( 
+            "ou=SAP-IAP,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: SAP-IAP", 
+            "administrativeRole: CollectiveAttributeInnerArea",
+            "administrativeRole: CollectiveAttributeSpecificArea"
+            );
+
+        // It should fail
+        AddResponse response = adminConnection.add( sapiap );
+
+        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
+    }
+    
+    
+    /**
+     * Test the addition of an SAP with the same IAP (TriggerExecution)
+     */
+    @Test
+    public void testAddIAPWithSAPTriggerExecution() throws Exception
+    {
+        Entry sapiap = LdifUtils.createEntry( 
+            "ou=SAP-IAP,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: SAP-IAP", 
+            "administrativeRole: TriggerExecutionInnerArea",
+            "administrativeRole: TriggerExecutionSpecificArea"
+            );
+
+        // It should fail
+        AddResponse response = adminConnection.add( sapiap );
+
+        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
+    }
+    
+    
+    /**
+     * Test the addition of an IAP within an IAP (TriggerExecution)
+     */
+    @Test
+    public void testAddIAPWithinAAPTriggerExecution() throws Exception
+    {
+        Entry sapiap = LdifUtils.createEntry( 
+            "ou=SAP-IAP,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: SAP-IAP", 
+            "administrativeRole: autonomousArea",
+            "administrativeRole: TriggerExecutionInnerArea"
+            );
+
+        // It should fail
+        AddResponse response = adminConnection.add( sapiap );
+
+        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
+    }
+    
+    
+    /**
      * Test the addition of an AAP with no role
      */
     @Test
@@ -275,8 +356,79 @@ public class AdministrativePointServiceI
 
         assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
     }
+
+
+    /**
+     * Test the addition of some invalid role
+     * @throws Exception
+     */
+    @Test
+    public void testAddInvalidRole() throws Exception
+    {
+        Entry autonomousArea = LdifUtils.createEntry( 
+            "ou=autonomousArea, ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: autonomousArea", 
+            "administrativeRole: accessControlBadArea",
+            "administrativeRole: TRIGGEREXECUTIONINNERAREA" );
+
+        AddResponse response = adminConnection.add( autonomousArea );
+
+        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
+    }
     
     
+    /**
+     * Test the addition of some roles more than once
+     * @throws Exception
+     */
+    @Test
+    public void testAddRoleMoreThanOnce() throws Exception
+    {
+        Entry autonomousArea = LdifUtils.createEntry( 
+            "ou=autonomousArea, ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: autonomousArea", 
+            "administrativeRole: autonomousArea",
+            "administrativeRole: 2.5.23.1" );
+
+        // It should not succeed
+        AddResponse response = adminConnection.add( autonomousArea );
+
+        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
+    }
+    
+    
+    /**
+     * Test the addition of an IAP under a SAP for a different role
+     */
+    @Test
+    public void testAddIAPUnderSAPDifferentRole() throws Exception
+    {
+        // First add an SAP
+        Entry sap = LdifUtils.createEntry( 
+            "ou=SAP1,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: SAP", 
+            "administrativeRole: accessControlSpecificArea" );
+
+        AddResponse response = adminConnection.add( sap );
+        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        
+        // Add a IAP now
+        Entry iap = LdifUtils.createEntry( 
+            "ou=IAP,ou=SAP1,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "ou: IAP",
+            "administrativeRole: collectiveATtributeInnerArea" );
+
+        response = adminConnection.add( iap );
+        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
+    }
     
     
     // -------------------------------------------------------------------
@@ -312,15 +464,6 @@ public class AdministrativePointServiceI
             "triggerExecutionSpecificArea", "subSchemaSpecificArea" ) );
     }
 
-    
-    
-    
-    
-    
-    
-    
-    
-
 
     /**
      * Test the addition of an autonomous area
@@ -340,6 +483,10 @@ public class AdministrativePointServiceI
         AddResponse response = adminConnection.add( autonomousArea );
 
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        
+        Entry adminPoint = adminConnection.lookup( "ou=autonomousArea, ou=system", "+" );
+        assertNotNull( adminPoint );
+        assertEquals( -1, Long.parseLong( adminPoint.get( "APSeqNumber" ).getString() ) );
 
         // Check that the entry is containing all the roles
         Entry entry = getAdminRole( "ou=autonomousArea, ou=system" );
@@ -373,7 +520,6 @@ public class AdministrativePointServiceI
      * @throws Exception
      */
     @Test
-    @Ignore
     public void testAddSpecificAreas() throws Exception
     {
         Entry autonomousArea = LdifUtils.createEntry( 
@@ -404,7 +550,6 @@ public class AdministrativePointServiceI
      * @throws Exception
      */
     @Test
-    @Ignore
     public void testAddInnerAreas() throws Exception
     {
         Entry autonomousArea = LdifUtils.createEntry( 
@@ -426,465 +571,56 @@ public class AdministrativePointServiceI
         assertTrue( entry.contains( "administrativeRole", "accessControlInnerArea" ) );
         assertTrue( entry.contains( "administrativeRole", "triggerExecutionInnerArea" ) );
     }
-
-
-    /**
-     * Test the addition of some invalid role
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testAddInvalidRole() throws Exception
-    {
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=autonomousArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: autonomousArea", 
-            "administrativeRole: accessControlBadArea",
-            "administrativeRole: TRIGGEREXECUTIONINNERAREA" );
-
-        AddResponse response = adminConnection.add( autonomousArea );
-
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
-    }
-
-
-    /**
-     * Test the addition of some specific and inner for the same role at the same place
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testAddInnerAndSpecificRole() throws Exception
-    {
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=autonomousArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: autonomousArea", 
-            "administrativeRole: accessControlSpecificArea",
-            "administrativeRole: accessControlInnerArea" );
-
-        AddResponse response = adminConnection.add( autonomousArea );
-
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
-    }
     
     
     /**
-     * Test the addition of some roles more than once
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testAddRoleMorehanOnce() throws Exception
-    {
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=autonomousArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: autonomousArea", 
-            "administrativeRole: autonomousArea",
-            "administrativeRole: 2.5.23.1" );
-
-        // It should not succeed
-        AddResponse response = adminConnection.add( autonomousArea );
-
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
-    }
-
-
-    // -------------------------------------------------------------------
-    // Test the Modify operation
-    // -------------------------------------------------------------------
-    /**
-     * Test the addition of a ACSA to a CASA
-     * @throws Exception
+     * Test the addition of an IAP under a SAP
      */
     @Test
-    @Ignore
-    public void testModifyAddSpecificArea() throws Exception
+    public void testAddIAPUnderSAP() throws Exception
     {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "accessControlSpecificArea"
) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        Entry entry = getAdminRole( "ou=caArea, ou=system" );
-
-        assertTrue( entry.contains( "administrativeRole", "accessControlSpecificArea" ) );
-        assertTrue( entry.contains( "administrativeRole", "collectiveAttributeSpecificArea"
) );
-    }
-
-
-    /**
-     * Test the addition of a ACIA to a CASA
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyAddInnerArea() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "accessControlInnerArea" ) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        Entry entry = getAdminRole( "ou=caArea, ou=system" );
-
-        assertTrue( entry.contains( "administrativeRole", "collectiveAttributeSpecificArea"
) );
-        assertTrue( entry.contains( "administrativeRole", "accessControlInnerArea" ) );
-    }
-
-
-    /**
-     * Test the addition of a CAIA to a CASA
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyAddInnerAreaToSameSpecificArea() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "collectiveAttributeInnerArea"
) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
-    }
-
-
-    /**
-     * Test the addition of the same CASA
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyAddSameSpecificArea() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "collectiveAttributeSpecificArea"
) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        assertEquals( ResultCodeEnum.ATTRIBUTE_OR_VALUE_EXISTS, response.getLdapResult().getResultCode()
);
-    }
-
-
-    /**
-     * Test the deletion of all the roles
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyDeleteAll() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea",
-            "administrativeRole: accessControlSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole" ) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        Entry entry = getAdminRole( "ou=caArea, ou=system" );
-
-        assertFalse( entry.contains( "administrativeRole" ) );
-    }
-
-
-    /**
-     * Test the deletion of all the roles
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyDeleteAll2() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea",
-            "administrativeRole: accessControlSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "collectiveAttributeSpecificArea",
-                "accessControlSpecificArea" ) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        Entry entry = getAdminRole( "ou=caArea, ou=system" );
-
-        assertFalse( entry.contains( "administrativeRole" ) );
-    }
-
-
-    /**
-     * Test the deletion of some role
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyDeleteSomeRole() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
+        // First add an SAP
+        Entry sap = LdifUtils.createEntry( 
+            "ou=SAP1,ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea",
+            "ou: SAP", 
             "administrativeRole: accessControlSpecificArea" );
 
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "accessControlSpecificArea"
) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
+        AddResponse response = adminConnection.add( sap );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        Entry entry = getAdminRole( "ou=caArea, ou=system" );
-
-        assertTrue( entry.contains( "administrativeRole" ) );
-        assertTrue( entry.contains( "administrativeRole", "collectiveAttributeSpecificArea"
) );
-        assertFalse( entry.contains( "administrativeRole", "accessControlSpecificArea" )
);
-    }
-
-
-    /**
-     * Test the deletion of some role
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyDeleteSomeInexistingRole() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea",
-            "administrativeRole: accessControlSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "triggerExecutionSpecificArea"
) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        assertEquals( ResultCodeEnum.NO_SUCH_ATTRIBUTE, response.getLdapResult().getResultCode()
);
-    }
-
-
-    /**
-     * Test the a combined operation
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyCombined() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
+        
+        // Add a IAP now
+        Entry iap = LdifUtils.createEntry( 
+            "ou=IAP,ou=SAP1,ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea",
-            "administrativeRole: accessControlSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Add another specific area
-        Modification modification1 = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "triggerExecutionSpecificArea"
) );
-        Modification modification2 = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "triggerExecutionSpecificArea"
) );
-
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification1,
modification2,
-            modification1 );
+            "ou: IAP",
+            "administrativeRole: accessControlInnerArea" );
 
+        response = adminConnection.add( iap );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
-        Entry entry = getAdminRole( "ou=caArea, ou=system" );
-
-        assertTrue( entry.contains( "administrativeRole" ) );
-        assertTrue( entry.contains( "administrativeRole", "collectiveAttributeSpecificArea"
) );
-        assertTrue( entry.contains( "administrativeRole", "accessControlSpecificArea" ) );
-        assertTrue( entry.contains( "administrativeRole", "triggerExecutionSpecificArea"
) );
-    }
-
-
-    /**
-     * Test the replace modification : it's not supported
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testModifyReplace() throws Exception
-    {
-        // Inject an CASA
-        Entry caArea = LdifUtils.createEntry( 
-            "ou=caArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: caArea", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        adminConnection.add( caArea );
-
-        // Try to modify it to an InnerArea
-        Modification modification = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
-            new DefaultEntryAttribute( "administrativeRole", "collectiveAttributeSpecificArea"
) );
-        ModifyResponse response = adminConnection.modify( "ou=caArea, ou=system", modification
);
-
-        // Should fail
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
     }
-
-
+    
+    
+    // ===================================================================
+    // Test the Add operation for Subentrys
     // -------------------------------------------------------------------
-    // Test the Move operation
+    // Failure expected
     // -------------------------------------------------------------------
-    /**
-     * Test the move of an autonomous area
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testMoveAutonomousArea() throws Exception
-    {
-        // Inject an AAA
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=autonomousArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: autonomousArea", 
-            "administrativeRole: autonomousArea" );
-
-        adminConnection.add( autonomousArea );
-
-        // It should fail, as we haven't injected all the roles
-        ModifyDnResponse response = adminConnection.move( "ou=autonomousArea, ou=system",
"uid=admin, ou=system" );
-
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
-    }
-
 
     // -------------------------------------------------------------------
-    // Test the Move And Rename operation
+    // Success expected
     // -------------------------------------------------------------------
-    /**
-     * Test the move and rename of an autonomous area
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testMoveAndRenameAutonomousArea() throws Exception
-    {
-        // Inject an AAA
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=autonomousArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: autonomousArea", 
-            "administrativeRole: autonomousArea" );
-
-        adminConnection.add( autonomousArea );
-
-        // It should fail, as we haven't injected all the roles
-        ModifyDnResponse response = adminConnection.moveAndRename( "ou=autonomousArea, ou=system",
-            "ou=new autonomousArea, uid=admin, ou=system" );
-
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
-    }
-
-
+    
+    
+    // ===================================================================
+    // Test the Add operation for Entries
     // -------------------------------------------------------------------
-    // Test the Rename operation
+    // Failure expected
     // -------------------------------------------------------------------
-    /**
-     * Test the renaming of an autonomous area
-     * @throws Exception
-     */
-    @Test
-    @Ignore
-    public void testRenameAutonomousArea() throws Exception
-    {
-        // Inject an AAA
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=autonomousArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: autonomousArea", 
-            "administrativeRole: autonomousArea" );
-
-        adminConnection.add( autonomousArea );
 
-        // It should fail, as we haven't injected all the roles
-        ModifyDnResponse response = adminConnection.rename( "ou=autonomousArea, ou=system",
"ou=new autonomousArea" );
-
-        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode()
);
-    }
+    // -------------------------------------------------------------------
+    // Success expected
+    // -------------------------------------------------------------------
 }



Mime
View raw message