directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r663396 - in /directory/apacheds/trunk/core-integ/src: main/java/org/apache/directory/server/core/integ/ main/java/org/apache/directory/server/core/integ/state/ test/java/org/apache/directory/server/core/schema/
Date Wed, 04 Jun 2008 22:58:00 GMT
Author: elecharny
Date: Wed Jun  4 15:57:59 2008
New Revision: 663396

URL: http://svn.apache.org/viewvc?rev=663396&view=rev
Log:
o Implemented the @ApplyLdifs annotation
o Used it in SchemaServiceIT tests
o Fixed the tests in this class (for some reason, we where expecting a 2.5.4.3=schema when
the result was cn=schema)
o Added some missing JavaDoc

Modified:
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/AbstractState.java
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/NonExistentState.java
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedNormalState.java
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedPristineState.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java?rev=663396&r1=663395&r2=663396&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
(original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
Wed Jun  4 15:57:59 2008
@@ -77,6 +77,7 @@
     {
         super.run( notifier );
         Level cleanupLevel = getSettings().getCleanupLevel();
+        
         if ( cleanupLevel == Level.CLASS )
         {
             try
@@ -109,6 +110,7 @@
         test( getTestClass(), wrapMethod( method ), notifier, new InheritableSettings( description,
getSettings() ) );
 
         Level cleanupLevel = getSettings().getCleanupLevel();
+        
         if ( cleanupLevel == Level.METHOD )
         {
             try

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/AbstractState.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/AbstractState.java?rev=663396&r1=663395&r2=663396&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/AbstractState.java
(original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/AbstractState.java
Wed Jun  4 15:57:59 2008
@@ -20,10 +20,18 @@
 
 
 import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.InheritableSettings;
+import org.apache.directory.server.core.integ.IntegrationUtils;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.junit.internal.runners.TestClass;
 import org.junit.internal.runners.TestMethod;
 import org.junit.runner.notification.RunNotifier;
@@ -159,4 +167,38 @@
         LOG.error( REVERT_ERROR );
         throw new IllegalStateException( REVERT_ERROR );
     }
+
+    
+    /**
+     * Inject the Ldifs if any
+     *
+     * @param service the instantiated directory service
+     * @param settings the settings containing the ldif
+     */
+    protected void injectLdifs( DirectoryService service, InheritableSettings settings )
+    {
+        List<String> ldifs = new ArrayList<String>();
+
+        ldifs =  settings.getLdifs( ldifs );
+        
+        if ( ldifs.size() != 0 )
+        {
+            for ( String ldif:ldifs )
+            {
+                try
+                {
+                    StringReader in = new StringReader( ldif );
+                    LdifReader ldifReader = new LdifReader( in );
+                    LdifEntry entry = ldifReader.next();
+                    
+                    LdapContext root = IntegrationUtils.getRootContext( service );
+                    root.createSubcontext( entry.getDn(), entry.getAttributes() );
+                }
+                catch ( NamingException ne )
+                {
+                    LOG.error( "Cannot inject the following entry : {}. Skipped.", ldif );
+                }
+            }
+        }
+    }
 }

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/NonExistentState.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/NonExistentState.java?rev=663396&r1=663395&r2=663396&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/NonExistentState.java
(original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/NonExistentState.java
Wed Jun  4 15:57:59 2008
@@ -64,7 +64,7 @@
      * @param settings The inherited settings
      * @throws NamingException if we can't create the service
      */
-    public void create( InheritableSettings settings  ) throws NamingException
+    public void create( InheritableSettings settings ) throws NamingException
     {
         LOG.debug( "calling create()" );
 
@@ -162,6 +162,7 @@
                     return;
                 }
 
+                
                 context.setState( context.getStartedNormalState() );
                 context.getState().test( testClass, testMethod, notifier, settings );
                 return;

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedNormalState.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedNormalState.java?rev=663396&r1=663395&r2=663396&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedNormalState.java
(original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedNormalState.java
Wed Jun  4 15:57:59 2008
@@ -165,6 +165,9 @@
                     return;
                 }
 
+                // Inject the LDIFs, if any 
+                injectLdifs( context.getService(), settings );
+                
                 TestServiceContext.invokeTest( testClass, testMethod, notifier, settings.getDescription()
);
                 
                 try
@@ -183,6 +186,10 @@
                 return;
                 
             case RESTART :
+                // Inject the LDIFs, if any 
+                injectLdifs( context.getService(), settings );
+                
+
                 TestServiceContext.invokeTest( testClass, testMethod, notifier, settings.getDescription()
);
 
                 try
@@ -208,7 +215,7 @@
                     notifier.testAborted( settings.getDescription(), ne );
                     return;
                 }
-
+                
                 return;
                 
             default:

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedPristineState.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedPristineState.java?rev=663396&r1=663395&r2=663396&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedPristineState.java
(original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/state/StartedPristineState.java
Wed Jun  4 15:57:59 2008
@@ -120,6 +120,9 @@
         switch ( settings.getMode() )
         {
             case PRISTINE:
+                // Inject the LDIFs, if any 
+                injectLdifs( context.getService(), settings );
+                
                 TestServiceContext.invokeTest( testClass, testMethod, notifier, settings.getDescription()
);
                 
                 try
@@ -164,6 +167,9 @@
                     return;
                 }
 
+                // Inject the LDIFs, if any 
+                injectLdifs( context.getService(), settings );
+                
                 TestServiceContext.invokeTest( testClass, testMethod, notifier, settings.getDescription()
);
                 context.setState( context.getStartedNormalState() );
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java?rev=663396&r1=663395&r2=663396&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
Wed Jun  4 15:57:59 2008
@@ -20,10 +20,23 @@
 package org.apache.directory.server.core.schema;
 
 
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
+import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
+
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
@@ -31,25 +44,15 @@
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.ldap.LdapContext;
-import java.io.StringReader;
-import java.util.HashMap;
-import java.util.Map;
-
 
 /**
  * Test cases for the schema service.  This is for 
@@ -58,18 +61,32 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
+@ApplyLdifs( {
+    // Entry # 1
+    "dn: cn=person0,ou=system\n" +
+    "objectClass: person\n" +
+    "cn: person0\n" +
+    "sn: sn_person0\n",
+    // Entry # 2
+    "dn: cn=person1,ou=system\n" +
+    "objectClass: organizationalPerson\n" +
+    "cn: person1\n" +
+    "sn: sn_person1\n" +
+    "seealso: cn=Good One,ou=people,o=sevenSeas\n" +
+    "seealso:: Y249QmFkIEXDqWvDoCxvdT1wZW9wbGUsbz1zZXZlblNlYXM=\n",
+    // Entry # 3
+    "dn: cn=person2,ou=system\n" +
+    "objectClass: inetOrgPerson\n" +
+    "cn: person2\n" +
+    "sn: sn_person2\n" }
+    )
 @RunWith ( CiRunner.class )
 public class SchemaServiceIT
 {
+    /** The Directory service */
     public static DirectoryService service;
 
 
-    public void loadData() throws Exception
-    {
-        // super.setLdifPath( "./nonspecific.ldif", getClass() );
-    }
-
-
     /**
      * For <a href="https://issues.apache.org/jira/browse/DIRSERVER-925">DIRSERVER-925</a>.
      *
@@ -98,6 +115,7 @@
      *
      * @throws NamingException on error
      */
+    @Test
     public void testMultipleStructuralObjectClasses() throws NamingException
     {
         Attributes attrs = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC
);
@@ -123,6 +141,7 @@
      *
      * @throws NamingException on error
      */
+    @Test
     public void testAddingTwoDifferentEntitiesWithSameOid() throws NamingException
     {
         String numberOfGunsAttrLdif = "dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.999,ou=attributeTypes,cn=other,ou=schema\n"
+
@@ -164,7 +183,6 @@
         root.createSubcontext( numberOfGunsAttrEntry.getDn(), numberOfGunsAttrEntry.getAttributes()
);
          
         // should blow chuncks using same OID
-        //noinspection EmptyCatchBlock
         try
         {
             root.createSubcontext( shipOCEntry.getDn(), shipOCEntry.getAttributes() );
@@ -172,10 +190,17 @@
         }
         catch( NamingException e )
         {
+            assertTrue( true );
         }
     }
     
     
+    /**
+     * Test that we have all the needed ObjectClasses
+     * 
+     * @throws NamingException on error
+     */
+    @Test
     public void testFillInObjectClasses() throws NamingException
     {
         LdapContext sysRoot = getSystemContext( service );
@@ -199,13 +224,20 @@
     }
 
 
+    /**
+     * Search all the entries with a 'person' ObjectClass, or an ObjectClass
+     * inheriting from 'person' 
+     *
+     * @throws NamingException on error
+     */
+    @Test
     public void testSearchForPerson() throws NamingException
     {
         LdapContext sysRoot = getSystemContext( service );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
         Map<String, Attributes> persons = new HashMap<String, Attributes>();
-        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=person)",
controls );
+        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*person)",
controls );
         
         while ( results.hasMore() )
         {
@@ -216,12 +248,9 @@
         // admin is extra
         assertEquals( 4, persons.size() );
 
-        Attributes person;
-        Attribute ocs;
-
-        person = persons.get( "cn=person0,ou=system" );
+        Attributes person = persons.get( "cn=person0,ou=system" );
         assertNotNull( person );
-        ocs = person.get( "objectClass" );
+        Attribute ocs = person.get( "objectClass" );
         assertEquals( 2, ocs.size() );
         assertTrue( ocs.contains( "top" ) );
         assertTrue( ocs.contains( "person" ) );
@@ -245,6 +274,7 @@
     }
 
 
+    @Test
     public void testSearchForOrgPerson() throws NamingException
     {
         LdapContext sysRoot = getSystemContext( service );
@@ -262,12 +292,9 @@
         // admin is extra
         assertEquals( 3, orgPersons.size() );
 
-        Attributes orgPerson;
-        Attribute ocs;
-
-        orgPerson = orgPersons.get( "cn=person1,ou=system" );
+        Attributes orgPerson = orgPersons.get( "cn=person1,ou=system" );
         assertNotNull( orgPerson );
-        ocs = orgPerson.get( "objectClass" );
+        Attribute ocs = orgPerson.get( "objectClass" );
         assertEquals( 3, ocs.size() );
         assertTrue( ocs.contains( "top" ) );
         assertTrue( ocs.contains( "person" ) );
@@ -284,6 +311,7 @@
     }
 
 
+    @Test
     public void testSearchForInetOrgPerson() throws NamingException
     {
         LdapContext sysRoot = getSystemContext( service );
@@ -301,19 +329,18 @@
         // admin is extra
         assertEquals( 2, inetOrgPersons.size() );
 
-        Attributes inetOrgPerson;
-        Attribute ocs;
-
-        inetOrgPerson = inetOrgPersons.get( "cn=person2,ou=system" );
+        Attributes inetOrgPerson = inetOrgPersons.get( "cn=person2,ou=system" );
         assertNotNull( inetOrgPerson );
-        ocs = inetOrgPerson.get( "objectClass" );
+        Attribute ocs = inetOrgPerson.get( "objectClass" );
         assertEquals( 4, ocs.size() );
         assertTrue( ocs.contains( "top" ) );
         assertTrue( ocs.contains( "person" ) );
         assertTrue( ocs.contains( "organizationalPerson" ) );
         assertTrue( ocs.contains( "inetOrgPerson" ) );
     }
-    
+
+
+    @Test
     public void testSearchForSubSchemaSubEntryUserAttrsOnly() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -332,7 +359,7 @@
         assertEquals( 1, subSchemaEntry.size() );
         
         // It should be the normalized form of cn=schema
-        Attributes attrs = subSchemaEntry.get( "2.5.4.3=schema" );
+        Attributes attrs = subSchemaEntry.get( "cn=schema" );
         
         assertNotNull( attrs );
         
@@ -346,6 +373,8 @@
         assertNotNull( attrs.get( "objectClass" ) );
     }
 
+
+    @Test
     public void testSearchForSubSchemaSubEntryAllAttrs() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -366,7 +395,7 @@
         assertEquals( 1, subSchemaEntry.size() );
         
         // It should be the normalized form of cn=schema
-        Attributes attrs = subSchemaEntry.get( "2.5.4.3=schema" );
+        Attributes attrs = subSchemaEntry.get( "cn=schema" );
         
         assertNotNull( attrs );
         
@@ -408,6 +437,8 @@
         assertNotNull( attrs.get( "subtreeSpecification" ) );
     }
 
+    
+    @Test
     public void testSearchForSubSchemaSubEntrySingleAttributeSelected() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -428,7 +459,7 @@
         assertEquals( 1, subSchemaEntry.size() );
         
         // It should be the normalized form of cn=schema
-        Attributes attrs = subSchemaEntry.get( "2.5.4.3=schema" );
+        Attributes attrs = subSchemaEntry.get( "cn=schema" );
         
         assertNotNull( attrs );
         
@@ -452,11 +483,13 @@
         assertNull( attrs.get( "objectClasses" ) );
     }
 
+    
     /**
      * Test for DIRSERVER-1055.
      * Check if modifyTimestamp and createTimestamp are present in the search result,
      * if they are requested.
      */
+    @Test
     public void testSearchForSubSchemaSubEntryOperationalAttributesSelected() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -478,7 +511,7 @@
         assertEquals( 1, subSchemaEntry.size() );
         
         // It should be the normalized form of cn=schema
-        Attributes attrs = subSchemaEntry.get( "2.5.4.3=schema" );
+        Attributes attrs = subSchemaEntry.get( "cn=schema" );
         
         assertNotNull( attrs );
         
@@ -501,6 +534,8 @@
         assertNull( attrs.get( "objectClasses" ) );
     }
 
+
+    @Test
     public void testSearchForSubSchemaSubEntryBadFilter() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -521,6 +556,8 @@
         assertEquals( 0, subSchemaEntry.size() );
     }
 
+
+    @Test
     public void testSearchForSubSchemaSubEntryFilterEqualTop() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -541,7 +578,7 @@
         assertEquals( 1, subSchemaEntry.size() );
         
         // It should be the normalized form of cn=schema
-        Attributes attrs = subSchemaEntry.get( "2.5.4.3=schema" );
+        Attributes attrs = subSchemaEntry.get( "cn=schema" );
         
         assertNotNull( attrs );
         
@@ -569,6 +606,8 @@
         assertNotNull( attrs.get( "objectClasses" ) );
     }
 
+
+    @Test
     public void testSearchForSubSchemaSubEntryFilterEqualSubSchema() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -589,7 +628,7 @@
         assertEquals( 1, subSchemaEntry.size() );
         
         // It should be the normalized form of cn=schema
-        Attributes attrs = subSchemaEntry.get( "2.5.4.3=schema" );
+        Attributes attrs = subSchemaEntry.get( "cn=schema" );
         
         assertNotNull( attrs );
         
@@ -617,6 +656,8 @@
         assertNotNull( attrs.get( "objectClasses" ) );
     }
 
+
+    @Test
     public void testSearchForSubSchemaSubEntryNotObjectScope() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -637,6 +678,8 @@
         assertEquals( 0, subSchemaEntry.size() );
     }
 
+
+    @Test
     public void testSearchForSubSchemaSubEntryComposedFilters() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -656,12 +699,14 @@
         // We should have no entry in the result
         assertEquals( 0, subSchemaEntry.size() );
     }
-    
+
+
     /**
      * Test for DIRSERVER-844: storing of base 64 encoded values into H-R attributes
      *
      * @throws NamingException on error
      */
+    @Test
     public void testSearchSeeAlso() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -695,13 +740,14 @@
         assertTrue( seeAlso.contains( "cn=Bad E\u00e9k\u00e0,ou=people,o=sevenSeas" ) );
     }
 
-    
+
     /**
      * Doing a search with filtering attributes should work even if the attribute
      * is not valid 
      *
      * @throws NamingException on error
      */
+    @Test
     public void testSearchForUnknownAttributes() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -750,6 +796,7 @@
      *
      * @throws NamingException on error
      */
+    @Test
     public void testSearchAttributesOIDObjectClass() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -798,6 +845,7 @@
      *
      * @throws NamingException on error
      */
+    @Test
     public void testSearchAttributesOIDObjectClassName() throws NamingException
     {
         SearchControls controls = new SearchControls();
@@ -839,4 +887,55 @@
         ocs = person.get( "objectClass" );
         assertNull( ocs );
     }
+
+
+    /**
+     * Check that if we search for an attribute using its inherited
+     * AttributeType (ie, looking for name instead of givenName, surname, 
+     * commonName), we find all the entries.
+     *
+     * @throws NamingException
+     */
+    @Test
+    public void testSearchForName() throws NamingException
+    {
+        LdapContext sysRoot = getSystemContext( service );
+        SearchControls controls = new SearchControls();
+        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+        Map<String, Attributes> persons = new HashMap<String, Attributes>();
+
+        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(name=person*)",
controls );
+        
+        while ( results.hasMore() )
+        {
+            SearchResult result = results.next();
+            persons.put( result.getName(), result.getAttributes() );
+        }
+
+        assertEquals( 3, persons.size() );
+
+        Attributes person = persons.get( "cn=person0,ou=system" );
+        assertNotNull( person );
+        Attribute ocs = person.get( "objectClass" );
+        assertEquals( 2, ocs.size() );
+        assertTrue( ocs.contains( "top" ) );
+        assertTrue( ocs.contains( "person" ) );
+
+        person = persons.get( "cn=person1,ou=system" );
+        assertNotNull( person );
+        ocs = person.get( "objectClass" );
+        assertEquals( 3, ocs.size() );
+        assertTrue( ocs.contains( "top" ) );
+        assertTrue( ocs.contains( "person" ) );
+        assertTrue( ocs.contains( "organizationalPerson" ) );
+
+        person = persons.get( "cn=person2,ou=system" );
+        assertNotNull( person );
+        ocs = person.get( "objectClass" );
+        assertEquals( 4, ocs.size() );
+        assertTrue( ocs.contains( "top" ) );
+        assertTrue( ocs.contains( "person" ) );
+        assertTrue( ocs.contains( "organizationalPerson" ) );
+        assertTrue( ocs.contains( "inetOrgPerson" ) );
+    }
 }



Mime
View raw message