directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r430098 - in /directory/trunks/apacheds: core-plugin/src/main/antlr/ core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/ core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/ core/src/main/java/org/ap...
Date Wed, 09 Aug 2006 17:19:20 GMT
Author: akarasulu
Date: Wed Aug  9 10:19:19 2006
New Revision: 430098

URL: http://svn.apache.org/viewvc?rev=430098&view=rev
Log:
merging changes from 1.0-trunks: see commit 430093 for info

Modified:
    directory/trunks/apacheds/core-plugin/src/main/antlr/openldap.g
    directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
    directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParser.java
    directory/trunks/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeRegistry.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java
    directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
    directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java

Modified: directory/trunks/apacheds/core-plugin/src/main/antlr/openldap.g
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-plugin/src/main/antlr/openldap.g?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core-plugin/src/main/antlr/openldap.g (original)
+++ directory/trunks/apacheds/core-plugin/src/main/antlr/openldap.g Wed Aug  9 10:19:19 2006
@@ -114,8 +114,8 @@
 {
     public static final String[] EMPTY = new String[0];
 
-    private Map attributeTypes = new HashMap();
-    private Map objectClasses = new HashMap();
+    private List attributeTypes = new ArrayList();
+    private List objectClasses = new ArrayList();
     private ParserMonitor monitor = null;
 
 
@@ -131,15 +131,15 @@
     }
 
 
-    public Map getAttributeTypes()
+    public List getAttributeTypes()
     {
-        return Collections.unmodifiableMap( attributeTypes );
+        return Collections.unmodifiableList( attributeTypes );
     }
 
 
-    public Map getObjectClasses()
+    public List getObjectClasses()
     {
-        return Collections.unmodifiableMap( objectClasses );
+        return Collections.unmodifiableList( objectClasses );
     }
 
 
@@ -206,7 +206,7 @@
     ( may[objectClass] )?
     CLOSE_PAREN
     {
-        objectClasses.put( objectClass.getOid(), objectClass );
+        objectClasses.add( objectClass );
     }
     ;
 
@@ -378,7 +378,7 @@
 
     CLOSE_PAREN
     {
-        attributeTypes.put( type.getOid(), type );
+        attributeTypes.add( type );
     }
     ;
 

Modified: directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
(original)
+++ directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
Wed Aug  9 10:19:19 2006
@@ -221,7 +221,7 @@
 
         int size = parser.getAttributeTypes().size();
         AttributeTypeLiteral[] attributeTypes = new AttributeTypeLiteral[size];
-        attributeTypes = ( AttributeTypeLiteral[] ) parser.getAttributeTypes().values().toArray(
attributeTypes );
+        attributeTypes = ( AttributeTypeLiteral[] ) parser.getAttributeTypes().toArray( attributeTypes
);
 
         VelocityContext context = new VelocityContext();
         context.put( "package", schema.getPackageName() );
@@ -249,7 +249,7 @@
 
         int size = parser.getObjectClassTypes().size();
         ObjectClassLiteral[] objectClasses = new ObjectClassLiteral[size];
-        objectClasses = ( ObjectClassLiteral[] ) parser.getObjectClassTypes().values().toArray(
objectClasses );
+        objectClasses = ( ObjectClassLiteral[] ) parser.getObjectClassTypes().toArray( objectClasses
);
 
         VelocityContext context = new VelocityContext();
         context.put( "package", schema.getPackageName() );

Modified: directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParser.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParser.java
(original)
+++ directory/trunks/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParser.java
Wed Aug  9 10:19:19 2006
@@ -21,7 +21,7 @@
 import org.apache.directory.server.core.tools.schema.antlrOpenLdapSchemaParser;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 
-import java.util.Map;
+import java.util.List;
 import java.text.ParseException;
 import java.io.*;
 
@@ -77,13 +77,13 @@
     }
 
 
-    public Map getAttributeTypes()
+    public List getAttributeTypes()
     {
         return parser.getAttributeTypes();
     }
 
 
-    public Map getObjectClassTypes()
+    public List getObjectClassTypes()
     {
         return parser.getObjectClasses();
     }

Modified: directory/trunks/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java
(original)
+++ directory/trunks/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java
Wed Aug  9 10:19:19 2006
@@ -17,6 +17,8 @@
 package org.apache.directory.server.core.tools.schema;
 
 
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import junit.framework.TestCase;
@@ -61,7 +63,8 @@
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )";
 
         parser.parse( attributeTypeData );
-        Map attributeTypes = parser.getAttributeTypes();
+        List attributeTypeList = parser.getAttributeTypes();
+        Map attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.14"
);
 
         assertNotNull( type );
@@ -72,13 +75,28 @@
     }
 
 
+    private Map mapAttributeTypes( List attributeTypeList )
+    {
+        Map m = new HashMap();
+        
+        for ( int ii = 0 ; ii < attributeTypeList.size(); ii++ )
+        {
+            AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypeList.get( ii
);
+            m.put( type.getOid(), type );
+        }
+        
+        return m;
+    }
+
+
     public void testSimpleAttributeTypeParse() throws Exception
     {
         String attributeTypeData = "# adding a comment  \n" + "attributetype ( 2.5.4.2 NAME
'knowledgeInformation'\n"
             + "        DESC 'RFC2256: knowledge information'\n" + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        Map attributeTypes = parser.getAttributeTypes();
+        List attributeTypeList = parser.getAttributeTypes();
+        Map attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.2"
);
 
         assertNotNull( type );
@@ -96,7 +114,8 @@
             + "        DESC 'RFC2256: \"knowledge\" information'\n" + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        Map attributeTypes = parser.getAttributeTypes();
+        List attributeTypeList = parser.getAttributeTypes();
+        Map attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.2"
);
 
         assertNotNull( type );
@@ -115,7 +134,8 @@
             + "        DESC 'RFC2256: knowledge information'\n" + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        Map attributeTypes = parser.getAttributeTypes();
+        List attributeTypeList = parser.getAttributeTypes();
+        Map attributeTypes = mapAttributeTypes( attributeTypeList );
         AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.2"
);
 
         assertNotNull( type );
@@ -127,13 +147,28 @@
     }
 
 
+    private Map mapObjectClasses( List attributeTypeList )
+    {
+        Map m = new HashMap();
+        
+        for ( int ii = 0 ; ii < attributeTypeList.size(); ii++ )
+        {
+            ObjectClassLiteral type = ( ObjectClassLiteral ) attributeTypeList.get( ii );
+            m.put( type.getOid(), type );
+        }
+        
+        return m;
+    }
+
+
     public void testObjectClassParse() throws Exception
     {
         String objectClassData = "objectclass ( 2.5.6.6 NAME 'person'\n" + "        DESC
'RFC2256: a person'\n"
             + "        SUP top STRUCTURAL\n" + "        MUST ( sn $ cn )\n"
             + "        MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )";
         parser.parse( objectClassData );
-        Map objectClasses = parser.getObjectClassTypes();
+        List objectClassesList = parser.getObjectClassTypes();
+        Map objectClasses = mapObjectClasses( objectClassesList );
         ObjectClassLiteral objectClass = ( ObjectClassLiteral ) objectClasses.get( "2.5.6.6"
);
 
         assertNotNull( objectClass );
@@ -162,7 +197,8 @@
             + "\t\tpagerTelephoneNumber $ organizationalStatus $\n"
             + "\t\tmailPreferenceOption $ personalSignature )\n" + "\t)";
         parser.parse( objectClassData );
-        Map objectClasses = parser.getObjectClassTypes();
+        List objectClassesList = parser.getObjectClassTypes();
+        Map objectClasses = mapObjectClasses( objectClassesList );
         ObjectClassLiteral objectClass = ( ObjectClassLiteral ) objectClasses.get( "0.9.2342.19200300.100.4.4"
);
 
         assertNotNull( objectClass );

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeRegistry.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeRegistry.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeRegistry.java
Wed Aug  9 10:19:19 2006
@@ -88,4 +88,17 @@
      * names.
      */
     Map getNormalizerMapping() throws NamingException; 
+    
+    
+    /**
+     * Get's an iterator over the set of descendant attributeTypes for
+     * some ancestor's name alias or their OID.
+     * 
+     * @param ancestorId the name alias or OID for an attributeType
+     * @return an Iterator over the AttributeTypes which have the ancestor
+     * within their superior chain to the top
+     * @throws NamingException if the ancestor attributeType cannot be 
+     * discerned from the ancestorId supplied
+     */
+    Iterator descendants( String ancestorId ) throws NamingException;
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
Wed Aug  9 10:19:19 2006
@@ -19,8 +19,10 @@
 
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 
 import javax.naming.NamingException;
 
@@ -50,6 +52,8 @@
     private final Map byOid;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
+    /** maps OIDs to a Set of descendants for that OID */
+    private final Map oidToDescendantSet;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
     /** cached normalizer mapping */
@@ -63,10 +67,11 @@
     /**
      * Creates an empty BootstrapAttributeTypeRegistry.
      */
-    public BootstrapAttributeTypeRegistry(OidRegistry oidRegistry)
+    public BootstrapAttributeTypeRegistry( OidRegistry oidRegistry )
     {
         this.byOid = new HashMap();
         this.oidToSchema = new HashMap();
+        this.oidToDescendantSet= new HashMap();
         this.oidRegistry = oidRegistry;
     }
 
@@ -91,6 +96,7 @@
             oidRegistry.register( names[ii], attributeType.getOid() );
         }
 
+        registerDescendants( attributeType );
         oidToSchema.put( attributeType.getOid(), schema );
         byOid.put( attributeType.getOid(), attributeType );
         if ( log.isDebugEnabled() )
@@ -99,6 +105,43 @@
         }
     }
 
+    
+    public void registerDescendants( AttributeType attributeType ) throws NamingException
+    {
+        // add/create the descendent set for this attribute
+        oidToDescendantSet.put( attributeType.getOid(), new HashSet( 5 ) );
+        
+        // add this attribute to descendant list of other attributes in superior chain
+        onRegisterAddToAncestorDescendants( attributeType, attributeType.getSuperior() );
+    }
+    
+    
+    /**
+     * Recursively adds a new attributeType to the descendant's list of all ancestors
+     * until top is reached.  Top will not have the new type added.
+     * 
+     * @param newType the new attributeType being added
+     * @param ancestor some anscestor from superior up to and including top
+     * @throws NamingException
+     */
+    protected void onRegisterAddToAncestorDescendants( AttributeType newType, AttributeType
ancestor ) 
+        throws NamingException
+    {
+        if ( ancestor == null || ancestor.getName().equals( "top" ) )
+        {
+            return;
+        }
+        
+        Set descendants = ( Set ) oidToDescendantSet.get( ancestor.getOid() );
+        if ( descendants == null )
+        {
+            descendants = new HashSet( 5 );
+            oidToDescendantSet.put( ancestor.getOid(), descendants );
+        }
+        descendants.add( newType );
+        onRegisterAddToAncestorDescendants( newType, ancestor.getSuperior() );
+    }
+    
 
     public AttributeType lookup( String id ) throws NamingException
     {
@@ -187,5 +230,17 @@
         }
         
         return Collections.unmodifiableMap( mapping );
+    }
+
+
+    public Iterator descendants( String ancestorId ) throws NamingException
+    {
+        String oid = oidRegistry.getOid( ancestorId );
+        Set descendants = ( Set ) oidToDescendantSet.get( oid );
+        if ( descendants == null )
+        {
+            return Collections.EMPTY_SET.iterator();
+        }
+        return descendants.iterator();
     }
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalAttributeTypeRegistry.java
Wed Aug  9 10:19:19 2006
@@ -122,6 +122,8 @@
             mapping.put( aliases[jj], oidNormalizer );
             mapping.put( aliases[jj].toLowerCase(), oidNormalizer );
         }
+
+        bootstrap.registerDescendants( attributeType );
     }
 
 
@@ -210,5 +212,11 @@
             }
         }
         return Collections.unmodifiableMap( mapping );
+    }
+
+
+    public Iterator descendants( String ancestorId ) throws NamingException
+    {
+        return bootstrap.descendants( ancestorId );
     }
 }

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
(original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
Wed Aug  9 10:19:19 2006
@@ -451,4 +451,10 @@
     {
         return null;
     }
+
+
+    public Iterator descendants( String ancestorId ) throws NamingException
+    {
+        return null;
+    }
 }

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java?rev=430098&r1=430097&r2=430098&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
(original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
Wed Aug  9 10:19:19 2006
@@ -17,11 +17,14 @@
 package org.apache.directory.server.core.schema;
 
 
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.BasicAttribute;
 
-import org.apache.directory.server.core.schema.ObjectClassRegistry;
 import org.apache.directory.server.core.schema.SchemaService;
 import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapRegistries;
@@ -32,6 +35,7 @@
 import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 
 import junit.framework.TestCase;
 
@@ -42,26 +46,46 @@
  */
 public class SchemaServiceTest extends TestCase
 {
-    ObjectClassRegistry registry = null;
+    BootstrapRegistries registries = new BootstrapRegistries();
 
 
     public void setUp() throws Exception
     {
-        if ( registry != null )
-        {
-            return;
-        }
-
-        BootstrapRegistries registries = new BootstrapRegistries();
+        registries = new BootstrapRegistries();
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+        loader.load( new SystemSchema(), registries );
         loader.load( new ApacheSchema(), registries );
         loader.load( new CoreSchema(), registries );
         loader.load( new CosineSchema(), registries );
         loader.load( new InetorgpersonSchema(), registries );
-        loader.load( new SystemSchema(), registries );
-        registry = registries.getObjectClassRegistry();
     }
 
+    
+    public void testDescendants() throws Exception
+    {
+        AttributeTypeRegistry attrRegistry = registries.getAttributeTypeRegistry();
+        Iterator list = attrRegistry.descendants( "name" );
+        Set nameAttrs = new HashSet();
+        while ( list.hasNext() )
+        {
+            AttributeType type = ( AttributeType ) list.next();
+            nameAttrs.add( type.getName() );
+        }
+        assertEquals( "size of attributes extending name", 13, nameAttrs.size() );
+        assertTrue( nameAttrs.contains( "dmdName" ) );
+        assertTrue( nameAttrs.contains( "o" ) );
+        assertTrue( nameAttrs.contains( "c" ) );
+        assertTrue( nameAttrs.contains( "initials" ) );
+        assertTrue( nameAttrs.contains( "ou" ) );
+        assertTrue( nameAttrs.contains( "sn" ) );
+        assertTrue( nameAttrs.contains( "title" ) );
+        assertTrue( nameAttrs.contains( "l" ) );
+        assertTrue( nameAttrs.contains( "apacheExistance" ) );
+        assertTrue( nameAttrs.contains( "cn" ) );
+        assertTrue( nameAttrs.contains( "st" ) );
+        assertTrue( nameAttrs.contains( "givenName" ) );
+    }
+    
 
     public void testAlterObjectClassesBogusAttr() throws NamingException
     {
@@ -69,7 +93,7 @@
 
         try
         {
-            SchemaService.alterObjectClasses( attr, registry );
+            SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
             fail( "should not get here" );
         }
         catch ( LdapNamingException e )
@@ -78,7 +102,7 @@
         }
 
         attr = new BasicAttribute( "objectClass" );
-        SchemaService.alterObjectClasses( attr, registry );
+        SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
         assertEquals( 0, attr.size() );
     }
 
@@ -86,7 +110,7 @@
     public void testAlterObjectClassesNoAttrValue() throws NamingException
     {
         Attribute attr = new BasicAttribute( "objectClass" );
-        SchemaService.alterObjectClasses( attr, registry );
+        SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
         assertEquals( 0, attr.size() );
     }
 
@@ -94,7 +118,7 @@
     public void testAlterObjectClassesTopAttrValue() throws NamingException
     {
         Attribute attr = new BasicAttribute( "objectClass", "top" );
-        SchemaService.alterObjectClasses( attr, registry );
+        SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
         assertEquals( 0, attr.size() );
     }
 
@@ -102,7 +126,7 @@
     public void testAlterObjectClassesInetOrgPersonAttrValue() throws NamingException
     {
         Attribute attr = new BasicAttribute( "objectClass", "inetOrgPerson" );
-        SchemaService.alterObjectClasses( attr, registry );
+        SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
         assertEquals( 3, attr.size() );
         assertTrue( attr.contains( "person" ) );
         assertTrue( attr.contains( "organizationalPerson" ) );
@@ -114,7 +138,7 @@
     {
         Attribute attr = new BasicAttribute( "objectClass", "inetOrgPerson" );
         attr.add( "residentialPerson" );
-        SchemaService.alterObjectClasses( attr, registry );
+        SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
         assertEquals( 4, attr.size() );
         assertTrue( attr.contains( "person" ) );
         assertTrue( attr.contains( "organizationalPerson" ) );
@@ -128,7 +152,7 @@
         Attribute attr = new BasicAttribute( "objectClass", "inetOrgPerson" );
         attr.add( "residentialPerson" );
         attr.add( "dSA" );
-        SchemaService.alterObjectClasses( attr, registry );
+        SchemaService.alterObjectClasses( attr, registries.getObjectClassRegistry() );
         assertEquals( 6, attr.size() );
         assertTrue( attr.contains( "person" ) );
         assertTrue( attr.contains( "organizationalPerson" ) );



Mime
View raw message