directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r831373 [2/2] - in /directory/apacheds/branches/apacheds-schema: avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/director...
Date Fri, 30 Oct 2009 16:20:44 GMT
Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java Fri Oct 30 16:20:42 2009
@@ -50,9 +50,10 @@
 import org.apache.directory.server.core.schema.SchemaPartition;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -108,7 +109,6 @@
             DirectoryService service = new DefaultDirectoryService();
             service.setWorkingDirectory( new File( workingDirectory ) );
             SchemaPartition schemaPartition = service.getSchemaService().getSchemaPartition();
-            Registries registries = service.getRegistries();
             
             // Init the LdifPartition
             LdifPartition ldifPartition = new LdifPartition();
@@ -120,17 +120,22 @@
             SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
             
             schemaPartition.setWrappedPartition( ldifPartition );
-            schemaPartition.setRegistries( registries );
             
             JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+            
+            SchemaManager sm = new DefaultSchemaManager( loader );
 
-            List<Throwable> errors = loader.loadAllEnabled( registries, true );
+            sm.loadAllEnabled();
+            
+            List<Throwable> errors = sm.getErrors();
             
             if ( errors.size() != 0 )
             {
                 fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
             }
 
+            schemaPartition.setRegistries( sm.getRegistries() );
+
             extractor.extractOrCopy();
 
             service.getChangeLog().setEnabled( true );
@@ -144,7 +149,7 @@
             systemPartition.setId( "system" );
             ((JdbmPartition)systemPartition).setCacheSize( 500 );
             systemPartition.setSuffix( ServerDNConstants.SYSTEM_DN );
-            systemPartition.setRegistries( registries );
+            systemPartition.setRegistries( sm.getRegistries() );
             ((JdbmPartition)systemPartition).setPartitionDir( new File( workingDirectory, "system" ) );
     
             // Add objectClass attribute for the system partition
@@ -154,15 +159,20 @@
             ( ( JdbmPartition ) systemPartition ).setIndexedAttributes( indexedAttrs );
             
             service.setSystemPartition( systemPartition );
-            
+            schemaPartition.setSchemaManager( sm );
+
             Partition foo = new JdbmPartition();
             foo.setId( "foo" );
             foo.setSuffix( "dc=foo,dc=com" );
+            foo.setRegistries( sm.getRegistries() );
+            ((JdbmPartition)foo).setPartitionDir( new File( workingDirectory, "foo" ) );
             service.addPartition( foo );
             
             Partition bar = new JdbmPartition();
             bar.setId( "bar" );
             bar.setSuffix( "dc=bar,dc=com" );
+            bar.setRegistries( sm.getRegistries() );
+            ((JdbmPartition)bar).setPartitionDir( new File( workingDirectory, "bar" ) );
             service.addPartition( bar );
             
             return service;

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/resources/log4j.properties?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/resources/log4j.properties (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/resources/log4j.properties Fri Oct 30 16:20:42 2009
@@ -14,11 +14,33 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #############################################################################
-log4j.rootCategory=OFF, stdout
+log4j.rootCategory=ERROR, stdout
 
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
 log4j.logger.org.apache.directory.server.core.integ=ERROR
 
+log4j.logger.org.apache.directory.shared.ldap.schema.comparators=ERROR
+log4j.logger.org.apache.directory.shared.ldap.schema.syntaxCheckers=ERROR
+log4j.logger.org.apache.directory.shared.ldap.ldif=ERROR
+log4j.logger.org.apache.directory.shared.ldap.schema.registries.SchemaObjectRegistry=ERROR
+log4j.logger.org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore=ERROR
+log4j.logger.org.apache.directory.server.core.DefaultOperationManager=ERROR
+log4j.logger.org.apache.directory.server.core.partition.DefaultPartitionNexus=ERROR
+log4j.logger.org.apache.directory.server.core.partition.ldif.LdifPartition=ERROR
+log4j.logger.org.apache.directory.server.core.authn.AuthenticationInterceptor=ERROR
+log4j.logger.org.apache.directory.shared.ldap.schema.registries.OidRegistry=ERROR
+log4j.logger.org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor=ERROR
+log4j.logger.org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader=ERROR
+log4j.logger.org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory=ERROR
+log4j.logger.org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry=ERROR
+log4j.logger.org.apache.directory.server.core.avltree=ERROR
+log4j.logger.org.apache.directory.server.core.entry.ServerEntrySerializer=ERROR
+log4j.logger.JdbmTable=ERROR
+log4j.logger.org.apache.directory.shared.ldap.schema.registries.ComparatorRegistry=ERROR
+log4j.logger.org.apache.directory.shared.ldap.schema.registries.NormalizerRegistry=ERROR
+log4j.logger.org.apache.directory.server.core.schema.registries.synchronizers.AbstractRegistrySynchronizer=DEBUG
+log4j.logger.org.apache.directory.shared.ldap.schema.registries.Registries=ERROR
+
 #log4j.logger.org.apache.directory.server.core.partition.PartitionIT=DEBUG

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Fri Oct 30 16:20:42 2009
@@ -60,7 +60,6 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Fri Oct 30 16:20:42 2009
@@ -97,9 +97,6 @@
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaService#getRegistries()
-     */
     public final Registries getRegistries()
     {
         return schemaPartition.getRegistries();

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Fri Oct 30 16:20:42 2009
@@ -101,6 +101,7 @@
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.schema.syntaxCheckers.OctetStringSyntaxChecker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -228,8 +229,8 @@
         computeSuperiors();
         
         // Initialize the schema manager
-        PartitionSchemaLoader loader = (PartitionSchemaLoader)schemaService.getSchemaPartition().getLoader();
-        SchemaPartitionDao dao = loader.getDao();
+        SchemaLoader loader = schemaService.getSchemaPartition().getSchemaManager().getLoader();
+        SchemaPartitionDao dao = (SchemaPartitionDao)loader.getDao();
         schemaManager = new SchemaSubentryManager( registries, loader, dao );
 
         MODIFIERS_NAME_ATTRIBUTE_TYPE = atRegistry.lookup( SchemaConstants.MODIFIERS_NAME_AT );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java Fri Oct 30 16:20:42 2009
@@ -50,6 +50,7 @@
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -111,7 +112,7 @@
     }
 
 
-    public SchemaSubentryManager( Registries registries, PartitionSchemaLoader loader, SchemaPartitionDao dao )
+    public SchemaSubentryManager( Registries registries, SchemaLoader loader, SchemaPartitionDao dao )
         throws Exception
     {
         this.registries = registries;

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java Fri Oct 30 16:20:42 2009
@@ -27,7 +27,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import javax.naming.NamingException;
@@ -41,8 +40,10 @@
 import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -81,15 +82,18 @@
     
     @BeforeClass public static void init() throws Exception
     {
-        registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+
+        registries = sm.getRegistries();
     }
     
     @Before public void setup() throws NamingException

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Fri Oct 30 16:20:42 2009
@@ -27,7 +27,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import javax.naming.directory.Attribute;
@@ -50,10 +49,12 @@
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -76,7 +77,7 @@
     private static Set<LdapDN> USER_NAMES = new HashSet<LdapDN>();
     private static Set<LdapDN> GROUP_NAMES = new HashSet<LdapDN>();
 
-    private static Registries registries = new Registries();
+    private static Registries registries;
     private static AttributeTypeRegistry atRegistryA;
     private static AttributeTypeRegistry atRegistryB;
     private static OidRegistry OID_REGISTRY;
@@ -92,13 +93,17 @@
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
+        registries = sm.getRegistries();
+
         OID_REGISTRY = registries.getOidRegistry();
 
         GROUP_NAME = new LdapDN( "ou=test,ou=groups,ou=system" );

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java Fri Oct 30 16:20:42 2009
@@ -27,7 +27,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.core.entry.DefaultServerEntry;
@@ -40,8 +39,10 @@
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -77,16 +78,19 @@
     
     @BeforeClass public static void setup() throws Exception
     {
-        registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
+        registries = sm.getRegistries();
+
         LdapDN entryName = new LdapDN( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new ProtectedItem.MaxImmSub( 2 ) );
         ENTRY = new DefaultServerEntry( registries, entryName );

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java Fri Oct 30 16:20:42 2009
@@ -26,17 +26,18 @@
 import static org.junit.Assert.fail;
 
 import java.text.ParseException;
-import java.util.List;
 
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.NotNode;
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -59,16 +60,19 @@
     @BeforeClass
     public static void init() throws Exception
     {
-        registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
+        registries = sm.getRegistries();
+
         AttributeTypeRegistry attributeRegistry = registries.getAttributeTypeRegistry();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry );
         normVisitor = new FilterNormalizingVisitor( ncn, registries );

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java Fri Oct 30 16:20:42 2009
@@ -41,6 +41,7 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
@@ -49,6 +50,7 @@
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -81,14 +83,16 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+
+        registries = sm.getRegistries();
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java Fri Oct 30 16:20:42 2009
@@ -26,14 +26,15 @@
 import java.io.File;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -63,20 +64,22 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+
+        registries = sm.getRegistries();
         
-        errors = loader.loadWithDependencies( loader.getSchema( "nis" ), registries, true );
+        loaded = sm.loadWithDeps( "nis" );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
     }
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java Fri Oct 30 16:20:42 2009
@@ -27,14 +27,15 @@
 import java.io.File;
 import java.security.KeyPair;
 import java.security.cert.X509Certificate;
-import java.util.List;
 
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -74,14 +75,16 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
-        
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+
+        registries = sm.getRegistries();
     }
     
     

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java Fri Oct 30 16:20:42 2009
@@ -23,8 +23,6 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.List;
-
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
@@ -33,9 +31,11 @@
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.NotNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -71,15 +71,18 @@
     @BeforeClass 
     public static void init() throws Exception
     {
-        registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+
+        registries = sm.getRegistries();
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java Fri Oct 30 16:20:42 2009
@@ -24,8 +24,6 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.List;
-
 import javax.naming.NamingException;
 
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
@@ -34,9 +32,11 @@
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.GreaterEqNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -69,25 +69,29 @@
     @BeforeClass 
     public static void init() throws Exception
     {
-        registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+
+        registries = sm.getRegistries();
         
         OBJECT_CLASS = registries.getAttributeTypeRegistry().lookup( "objectClass" );
     }
     
 
     /**
-     * Initializes registries and creates the leaf evalutator
+     * Initializes registries and creates the leaf evaluator
      * @throws Exception if there are schema initialization problems
      */
-    @Before public void setUp() throws Exception
+    @Before 
+    public void setUp() throws Exception
     {
         OidRegistry registry = registries.getOidRegistry();
         evaluator = new RefinementLeafEvaluator( registry );

Modified: directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java Fri Oct 30 16:20:42 2009
@@ -26,7 +26,6 @@
 
 import java.io.File;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.core.entry.DefaultServerEntry;
@@ -35,6 +34,7 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
@@ -42,6 +42,7 @@
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -81,14 +82,16 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+
+        registries = sm.getRegistries();
     	
         attributeRegistry = registries.getAttributeTypeRegistry();
         

Modified: directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java Fri Oct 30 16:20:42 2009
@@ -27,7 +27,6 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -35,11 +34,13 @@
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
@@ -90,15 +91,16 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( workingDirectory );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
-        
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
-        
+
+        registries = sm.getRegistries();
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 
         // --------------------------------------------------------------------

Modified: directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java Fri Oct 30 16:20:42 2009
@@ -28,7 +28,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -37,11 +36,12 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -78,18 +78,18 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        Registries registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
-        SerializableComparator.setRegistry( registries.getComparatorRegistry() );
+        SerializableComparator.setRegistry( sm.getRegistries().getComparatorRegistry() );
 
-        registry = registries.getAttributeTypeRegistry();
+        registry = sm.getRegistries().getAttributeTypeRegistry();
     }
     
     

Modified: directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java Fri Oct 30 16:20:42 2009
@@ -25,15 +25,16 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 
 import jdbm.RecordManager;
 import jdbm.recman.BaseRecordManager;
 
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -77,14 +78,16 @@
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         Registries registries = new Registries();
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
-        attributeRegistry = registries.getAttributeTypeRegistry();
+        attributeRegistry = sm.getRegistries().getAttributeTypeRegistry();
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Fri Oct 30 16:20:42 2009
@@ -60,12 +60,14 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -109,15 +111,16 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
+        registries = sm.getRegistries();
         attributeRegistry = registries.getAttributeTypeRegistry();
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
     }

Modified: directory/apacheds/branches/apacheds-schema/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java Fri Oct 30 16:20:42 2009
@@ -28,7 +28,6 @@
 
 import java.io.File;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 
@@ -59,10 +58,12 @@
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -104,23 +105,22 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
+        registries = sm.getRegistries();
         defaultCSNFactory = new CsnFactory( 0 );
         
         wkdir = File.createTempFile( LdifPartitionTest.class.getSimpleName(), "db" );
         wkdir.delete();
         wkdir = new File( wkdir.getParentFile(), LdifPartitionTest.class.getSimpleName() );
         FileUtils.deleteDirectory( wkdir );
-        //wkdir.mkdirs();
-
     }
 
     

Modified: directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java (original)
+++ directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java Fri Oct 30 16:20:42 2009
@@ -52,6 +52,7 @@
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
@@ -59,6 +60,7 @@
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.Base64;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 
 
@@ -101,16 +103,21 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        Registries registries = new Registries();
-
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        SchemaManager sm = new DefaultSchemaManager( loader );
+        sm.loadAllEnabled();
+        Registries registries = sm.getRegistries();
+        
+        List<Throwable> errors = sm.getErrors();
         
         if ( errors.size() != 0 )
         {
             fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
         }
 
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        
+        sm.loadWithDeps( "collective" );
+        
+        errors = sm.getErrors();
         
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java Fri Oct 30 16:20:42 2009
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.comparators.ByteArrayComparator;
@@ -57,7 +58,7 @@
     private final Normalizer normalizer;
     
     /** The comparator to use */
-    private final Comparator comparator;
+    private final LdapComparator<?> comparator;
     
     /** The default byte[] comparator if no comparator has been defined */
     private static final Comparator<byte[]> BINARY_COMPARATOR = ByteArrayComparator.INSTANCE;
@@ -204,7 +205,7 @@
                 
                 if ( comparator != null )
                 {
-                    if ( ( comparator.compare( serverValue, nodeValue ) == 0 ) )
+                    if ( ( ((LdapComparator<byte[]>)comparator).compare( serverValue, nodeValue ) == 0 ) )
                     {
                         return true;
                     }
@@ -234,7 +235,7 @@
                 
                 if ( comparator != null )
                 {
-                    if ( comparator.compare( serverValue, nodeValue ) == 0 )
+                    if ( ((LdapComparator<String>)comparator).compare( serverValue, nodeValue ) == 0 )
                     {
                         return true;
                     }

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java Fri Oct 30 16:20:42 2009
@@ -45,11 +45,13 @@
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -94,20 +96,21 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        boolean loaded = sm.loadAllEnabled();
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        loaded = sm.loadWithDeps( "collective" );
+        registries = sm.getRegistries();
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
 
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java Fri Oct 30 16:20:42 2009
@@ -47,6 +47,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.comparators.StringComparator;
@@ -55,6 +56,7 @@
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -98,22 +100,24 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
+        registries = sm.getRegistries();
+        
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 
         attributeRegistry = registries.getAttributeTypeRegistry();

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java Fri Oct 30 16:20:42 2009
@@ -47,6 +47,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.comparators.StringComparator;
@@ -55,6 +56,7 @@
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -98,21 +100,23 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+        
+        registries = sm.getRegistries();
 
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java Fri Oct 30 16:20:42 2009
@@ -26,7 +26,6 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -40,12 +39,14 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -92,16 +93,23 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
+
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
+        }
         
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        registries = sm.getRegistries();
         
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java Fri Oct 30 16:20:42 2009
@@ -26,7 +26,6 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -43,11 +42,13 @@
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.NotNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -92,21 +93,23 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+        
+        registries = sm.getRegistries();
 
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java Fri Oct 30 16:20:42 2009
@@ -27,7 +27,6 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
@@ -46,12 +45,14 @@
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -95,23 +96,25 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+        
+        registries = sm.getRegistries();
 
-        SerializableComparator.setRegistry( registries.getComparatorRegistry() );
+        SerializableComparator.setRegistry( sm.getRegistries().getComparatorRegistry() );
 
         attributeRegistry = registries.getAttributeTypeRegistry();
     }

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java Fri Oct 30 16:20:42 2009
@@ -45,11 +45,13 @@
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.OrNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -97,21 +99,23 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+        
+        registries = sm.getRegistries();
 
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java Fri Oct 30 16:20:42 2009
@@ -26,7 +26,6 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -38,11 +37,13 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -84,21 +85,23 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
-
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
         
-        if ( errors.size() != 0 )
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
+        
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+        
+        registries = sm.getRegistries();
 
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Fri Oct 30 16:20:42 2009
@@ -26,7 +26,6 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -38,11 +37,13 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -84,21 +85,23 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
+        boolean loaded = sm.loadAllEnabled();
+
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
         
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
         
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+        
+        registries = sm.getRegistries();
 
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java?rev=831373&r1=831372&r2=831373&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java Fri Oct 30 16:20:42 2009
@@ -28,7 +28,6 @@
 import static org.junit.Assert.fail;
 
 import java.io.File;
-import java.util.List;
 import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
@@ -47,11 +46,13 @@
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -94,21 +95,23 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        registries = new Registries();
-        
-        List<Throwable> errors = loader.loadAllEnabled( registries, true );
-        
-        if ( errors.size() != 0 )
-        {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
-        }
+        SchemaManager sm = new DefaultSchemaManager( loader );
 
-        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        boolean loaded = sm.loadAllEnabled();
 
-        if ( errors.size() != 0 )
+        if ( !loaded )
         {
-            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
         }
+        
+        loaded = sm.loadWithDeps( loader.getSchema( "collective" ) );
+        
+        if ( !loaded )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( sm.getErrors() ) );
+        }
+        
+        registries = sm.getRegistries();
 
         attributeRegistry = registries.getAttributeTypeRegistry();
     }



Mime
View raw message