You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/12/27 17:12:08 UTC

svn commit: r1053096 - /directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java

Author: elecharny
Date: Mon Dec 27 16:12:07 2010
New Revision: 1053096

URL: http://svn.apache.org/viewvc?rev=1053096&view=rev
Log:
Adding some additional checks

Modified:
    directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java

Modified: directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.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?rev=1053096&r1=1053095&r2=1053096&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java Mon Dec 27 16:12:07 2010
@@ -26,6 +26,8 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.server.core.administrative.AdministrativePoint;
+import org.apache.directory.server.core.administrative.Subentry;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -36,6 +38,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.message.AddResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -817,6 +820,32 @@ public class SubentryAddOperationIT exte
 
         response = adminConnection.add( subentry );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        
+        DN subentryDN = new DN( "cn=test, ou=AAP2,ou=system" );
+        
+        // Get back the subentry
+        Entry addedSE = adminConnection.lookup( subentryDN, "+" );
+        String subentryUUID = addedSE.get( "entryUUID" ).getString();
+        
+        DN apDn = new DN( "ou=AAP2,ou=system" );
+        apDn.normalize( service.getSchemaManager() );
+        
+        // Check that we have a ref to the added subentry in the two APs (AC and CA)
+        AdministrativePoint apAC = service.getAccessControlAPCache().getElement( apDn );
+        
+        assertNotNull( apAC.getSubentries() );
+        assertEquals( 1, apAC.getSubentries().size() );
+        Subentry subentryAC = (Subentry)(apAC.getSubentries().toArray()[0]);
+        
+        assertEquals( subentryAC.getUuid(), subentryUUID );
+
+        AdministrativePoint apCA = service.getCollectiveAttributeAPCache().getElement( apDn );
+        
+        assertNotNull( apCA.getSubentries() );
+        assertEquals( 1, apCA.getSubentries().size() );
+        Subentry subentryCA = (Subentry)(apCA.getSubentries().toArray()[0]);
+        
+        assertEquals( subentryCA.getUuid(), subentryUUID );
     }