directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r824528 [1/3] - in /directory: apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/ a...
Date Mon, 12 Oct 2009 22:44:54 GMT
Author: elecharny
Date: Mon Oct 12 22:44:52 2009
New Revision: 824528

URL: http://svn.apache.org/viewvc?rev=824528&view=rev
Log:
o The loadAllEnabled()/loadWithDependencies() methods now return the list of errors if the schema is invalid
o They also take an additionnal parameter (check) to tell the method if it should check the registries when the schema have been loaded
o Added some flags in the Registries class to handle a strict/relaxed checking, and to allow disabled SchemaObjects
o Fixed the tests to reflect these changes
o Reviewed the registerXXX methods
o Reviewed the checkRefInteg method
o Added a constructor to the OctetStringSyntaxChecker, to create instances with a specific OID
o Reviewed the load<SchemaObject>() methods, using the common load method

Modified:
    directory/apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java
    directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java
    directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java
    directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
    directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
    directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
    directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
    directory/apacheds/branches/apacheds-schema/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/branches/apacheds-schema/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
    directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/JarLdifSchemaLoader.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/LdifSchemaLoader.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/loader/ldif/JarLdifSchemaLoaderTest.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/loader/ldif/LdifSchemaLoaderTest.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimNormalizer.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimToLowerNormalizer.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDnNormalizer.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OctetStringSyntaxChecker.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/util/ExceptionUtils.java

Modified: directory/apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java Mon Oct 12 22:44:52 2009
@@ -63,6 +63,7 @@
 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.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -105,8 +106,15 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         attributeRegistry = registries.getAttributeTypeRegistry();
     }

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Mon Oct 12 22:44:52 2009
@@ -47,7 +47,6 @@
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -260,7 +259,7 @@
             }
         }
 
-        loadWithDependencies( enabledSchemaSet, targetRegistries );
+        loadWithDependencies( enabledSchemaSet, targetRegistries, true );
     }
     
     
@@ -337,8 +336,16 @@
     }
 
 
-    public final void loadWithDependencies( Collection<Schema> schemas, Registries targetRegistries ) throws Exception
+    /**
+     * {@inheritDoc}
+     */
+    public final List<Throwable> loadWithDependencies( Collection<Schema> schemas, Registries targetRegistries, boolean check ) throws Exception
     {
+        // Relax the controls at first
+        List<Throwable> errors = new ArrayList<Throwable>();
+        boolean wasRelaxed = targetRegistries.isRelaxed();
+        targetRegistries.setRelaxed( true );
+
         HashMap<String,Schema> notLoaded = new HashMap<String,Schema>();
 
         for ( Schema schema : schemas )
@@ -354,6 +361,17 @@
             loadDepsFirst( schema, new Stack<String>(), notLoaded, schema, targetRegistries );
             list = notLoaded.values().iterator();
         }
+
+        // At the end, check the registries if required
+        if ( check )
+        {
+            errors = targetRegistries.checkRefInteg();
+        }
+        
+        // Restore the Registries isRelaxed flag
+        targetRegistries.setRelaxed( wasRelaxed );
+        
+        return errors;
     }
 
     /**
@@ -437,7 +455,7 @@
         {
             dn = new LdapDN( 
                 SchemaConstants.OBJECT_CLASSES_PATH, 
-                "cn=" + schema.getSchemaName(),
+                "cn", schema.getSchemaName(),
                 SchemaConstants.OU_SCHEMA );
             
             dn.normalize( atRegistry.getNormalizerMapping() );
@@ -458,20 +476,13 @@
             ClonedServerEntry result = list.get();
             LdapDN resultDN = result.getDn();
             resultDN.normalize( atRegistry.getNormalizerMapping() );
-            ClonedServerEntry attrs = lookupPartition( resultDN );
-            ObjectClass oc = factory.getObjectClass( attrs, targetRegistries, schema.getSchemaName() );
+            ClonedServerEntry entry = lookupPartition( resultDN );
             
-            try
-            {
-                targetRegistries.getObjectClassRegistry().register( oc );
-            }
-            catch ( Exception ne )
-            {
-                deferred.add( oc );
-            }
+            registerObjectClass( targetRegistries, entry, schema );
         }
         
         LOG.debug( "Deferred queue size = {}", deferred.size() );
+        
         if ( LOG.isDebugEnabled() )
         {
             StringBuffer buf = new StringBuffer();
@@ -488,6 +499,7 @@
         }
         
         int lastCount = deferred.size();
+        
         while ( ! deferred.isEmpty() )
         {
             LOG.debug( "Deferred queue size = {}", deferred.size() );
@@ -866,12 +878,12 @@
             ClonedServerEntry result = list.get();
             LdapDN resultDN = result.getDn();
             resultDN.normalize( atRegistry.getNormalizerMapping() );
-            ClonedServerEntry attrs = lookupPartition( resultDN );
-            LdapComparator<?> comparator = factory.getLdapComparator( attrs, targetRegistries, schema.getSchemaName() );
-            LdapComparatorDescription comparatorDescription = getLdapComparatorDescription( schema.getSchemaName(), attrs );
+            ClonedServerEntry entry = lookupPartition( resultDN );
+            
+            LdapComparatorDescription comparatorDescription = getLdapComparatorDescription( schema.getSchemaName(), entry );
             // @TODO elecharny what should I do with description
             
-            targetRegistries.getComparatorRegistry().register( comparator );
+            registerComparator( targetRegistries, entry, schema );
         }
     }
 
@@ -931,12 +943,31 @@
     }
 
     
-    public void loadWithDependencies( Schema schema, Registries registries ) throws Exception
+    /**
+     * {@inheritDoc}
+     */
+    public List<Throwable> loadWithDependencies( Schema schema, Registries registries, boolean check ) throws Exception
     {
+        // Relax the controls at first
+        List<Throwable> errors = new ArrayList<Throwable>();
+        boolean wasRelaxed = registries.isRelaxed();
+        registries.setRelaxed( true );
+
         HashMap<String,Schema> notLoaded = new HashMap<String,Schema>();
         notLoaded.put( schema.getSchemaName(), schema );                        
         Properties props = new Properties();
         loadDepsFirst( schema, new Stack<String>(), notLoaded, schema, registries );
+        
+        // At the end, check the registries if required
+        if ( check )
+        {
+            errors = registries.checkRefInteg();
+        }
+        
+        // Restore the Registries isRelaxed flag
+        registries.setRelaxed( wasRelaxed );
+        
+        return errors;
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Mon Oct 12 22:44:52 2009
@@ -60,6 +60,7 @@
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.util.DateUtils;
+import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -257,7 +258,15 @@
             throw new RuntimeException( e );
         }
 
-        loader.loadAllEnabled( registries );  
+        // Load the registries. We use a permissive registries at this point
+        // so even if the schema are not ordered or the SchemaObjects are not
+        // ordered in the schemas, we can still load them all.
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            throw new RuntimeException( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
         
         schemaModificationDN = new LdapDN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
         schemaModificationDN.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java Mon Oct 12 22:44:52 2009
@@ -651,7 +651,7 @@
             return SCHEMA_UNCHANGED;
         }
 
-        loader.loadWithDependencies( schema, registries );
+        loader.loadWithDependencies( schema, registries, true );
         schema = loader.getSchema( schemaName );
         schema.enable();
         

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java Mon Oct 12 22:44:52 2009
@@ -53,6 +53,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 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.ldap.util.StringTools;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
@@ -120,7 +121,15 @@
         extractor.extractOrCopy();
     	loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            // We have inconsistencies : log them and exit.
+            throw new RuntimeException( "Inconsistent schemas : " + 
+                ExceptionUtils.printErrors( errors ) );
+        }
         
         atCN = registries.getAttributeTypeRegistry().lookup( "cn" );
         atC = registries.getAttributeTypeRegistry().lookup( "c" );

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java Mon Oct 12 22:44:52 2009
@@ -20,6 +20,14 @@
 package org.apache.directory.server.core.entry;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -47,17 +55,9 @@
 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.ldap.util.StringTools;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -110,7 +110,13 @@
         extractor.extractOrCopy();
         loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         atr = registries.getAttributeTypeRegistry();
 

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java Mon Oct 12 22:44:52 2009
@@ -20,8 +20,12 @@
 package org.apache.directory.server.core.entry;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -31,10 +35,9 @@
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 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.loader.ldif.LdifSchemaLoader;
-
-import static org.junit.Assert.assertEquals;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -72,7 +75,13 @@
         extractor.extractOrCopy();
         loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+        
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
         
         oids = new HashMap<String, OidNormalizer>();
 

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java Mon Oct 12 22:44:52 2009
@@ -20,12 +20,19 @@
 package org.apache.directory.server.core.entry;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.util.List;
 
 import javax.naming.NamingException;
 
@@ -38,14 +45,8 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 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.loader.ldif.LdifSchemaLoader;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.fail;
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -162,7 +163,14 @@
         extractor.extractOrCopy();
         loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+        
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
+
         atCN = registries.getAttributeTypeRegistry().lookup( "cn" );
         atC = registries.getAttributeTypeRegistry().lookup( "c" );
     }

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java Mon Oct 12 22:44:52 2009
@@ -19,8 +19,11 @@
 package org.apache.directory.server.core.integ;
 
 
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.constants.ServerDNConstants;
@@ -36,6 +39,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 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.loader.ldif.JarLdifSchemaLoader;
 
 
@@ -85,7 +89,14 @@
             schemaPartition.setRegistries( registries );
             
             JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-            loader.loadAllEnabled( registries );
+
+            List<Throwable> errors = loader.loadAllEnabled( registries, true );
+            
+            if ( errors.size() != 0 )
+            {
+                fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            }
+
             extractor.extractOrCopy();
 
             service.getChangeLog().setEnabled( true );

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java Mon Oct 12 22:44:52 2009
@@ -21,10 +21,12 @@
 
 
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Set;
 
 import javax.naming.Name;
@@ -53,6 +55,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 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.loader.ldif.JarLdifSchemaLoader;
 
 
@@ -99,7 +102,14 @@
             schemaPartition.setRegistries( registries );
             
             JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-            loader.loadAllEnabled( registries );
+
+            List<Throwable> errors = loader.loadAllEnabled( registries, true );
+            
+            if ( errors.size() != 0 )
+            {
+                fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            }
+
             extractor.extractOrCopy();
 
             service.getChangeLog().setEnabled( true );
@@ -161,7 +171,14 @@
             schemaPartition.setRegistries( registries );
             
             JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-            loader.loadAllEnabled( registries );
+
+            List<Throwable> errors = loader.loadAllEnabled( registries, true );
+            
+            if ( errors.size() != 0 )
+            {
+                fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            }
+
             extractor.extractOrCopy();
 
             service.getChangeLog().setEnabled( true );

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java Mon Oct 12 22:44:52 2009
@@ -29,6 +29,7 @@
 
 import java.io.File;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import javax.naming.NamingEnumeration;
@@ -62,6 +63,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 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.loader.ldif.JarLdifSchemaLoader;
 import org.junit.Before;
 import org.junit.Test;
@@ -114,7 +116,14 @@
             schemaPartition.setRegistries( registries );
             
             JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-            loader.loadAllEnabled( registries );
+
+            List<Throwable> errors = loader.loadAllEnabled( registries, true );
+            
+            if ( errors.size() != 0 )
+            {
+                fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            }
+
             extractor.extractOrCopy();
 
             service.getChangeLog().setEnabled( true );

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java Mon Oct 12 22:44:52 2009
@@ -24,9 +24,11 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import javax.naming.NamingEnumeration;
@@ -60,6 +62,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 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.loader.ldif.JarLdifSchemaLoader;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -158,7 +161,14 @@
             schemaPartition.setRegistries( registries );
             
             JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-            loader.loadAllEnabled( registries );
+
+            List<Throwable> errors = loader.loadAllEnabled( registries, true );
+            
+            if ( errors.size() != 0 )
+            {
+                fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            }
+
             extractor.extractOrCopy();
 
             service.getChangeLog().setEnabled( true );

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -28,6 +28,7 @@
 import java.io.File;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import javax.naming.directory.Attribute;
@@ -51,6 +52,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 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.loader.ldif.JarLdifSchemaLoader;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -121,7 +123,14 @@
             schemaPartition.setRegistries( registries );
             
             JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-            loader.loadAllEnabled( registries );
+
+            List<Throwable> errors = loader.loadAllEnabled( registries, true );
+            
+            if ( errors.size() != 0 )
+            {
+                fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+            }
+
             extractor.extractOrCopy();
 
             service.getChangeLog().setEnabled( true );

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java?rev=824528&r1=824527&r2=824528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java Mon Oct 12 22:44:52 2009
@@ -77,6 +77,30 @@
         return service.getRegistries().getAttributeTypeRegistry();
     }
     
+    
+    /*
+    @Before
+    public void checkBefore()
+    {
+        System.out.println( "--------------------Before, USING :" );
+        service.getRegistries().dumpUsing();
+        System.out.println( "--------------------Before, USED BY :" );
+        service.getRegistries().dumpUsedBy();
+        //assertTrue( service.getRegistries().check() );
+    }
+    
+    
+    @After
+    public void checkRegistries()
+    {
+        System.out.println( "--------------------After, USING :" );
+        service.getRegistries().dumpUsing();
+        System.out.println( "--------------------After, USED BY :" );
+        service.getRegistries().dumpUsedBy();
+        //assertTrue( service.getRegistries().check() );
+    }
+    */
+    
     /**
      * Gets relative DN to ou=schema.
      *

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -21,11 +21,13 @@
 
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import javax.naming.NamingException;
@@ -40,6 +42,7 @@
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -80,7 +83,13 @@
     {
         registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
     }
     
     @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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -21,11 +21,13 @@
 
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 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;
@@ -51,6 +53,7 @@
 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.loader.ldif.JarLdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -88,7 +91,13 @@
     @BeforeClass public static void setup() throws Exception
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         OID_REGISTRY = registries.getOidRegistry();
 

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -21,11 +21,13 @@
 
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 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;
@@ -39,6 +41,7 @@
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -76,7 +79,13 @@
     {
         registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         LdapDN entryName = new LdapDN( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new ProtectedItem.MaxImmSub( 2 ) );

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -23,8 +23,10 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+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;
@@ -34,6 +36,7 @@
 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.loader.ldif.JarLdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -58,7 +61,13 @@
     {
         registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         AttributeTypeRegistry attributeRegistry = registries.getAttributeTypeRegistry();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry );

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -23,36 +23,36 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import java.io.File;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import javax.naming.NamingException;
 
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.schema.SchemaChecker;
-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.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 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.ldif.extractor.SchemaLdifExtractor;
+import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
 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.ldap.util.StringTools;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import java.io.File;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 
 /**
  * Tests to make sure the schema checker is operating correctly.
@@ -82,15 +82,12 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
 
-        List<Throwable> errors = registries.checkRefInteg();
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
         
-        if ( !errors.isEmpty() )
+        if ( errors.size() != 0 )
         {
-            NamingException e = new NamingException();
-            e.setRootCause( ( Throwable ) errors.get( 0 ) );
-            throw e;
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
         }
     }
 

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -21,18 +21,21 @@
 
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 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.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.loader.ldif.LdifSchemaLoader;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 
@@ -44,8 +47,8 @@
     private static Registries registries;
     
     
-    @Before
-    public void setUp() throws Exception
+    @BeforeClass
+    public static void setUp() throws Exception
     {
     	String workingDirectory = System.getProperty( "workingDirectory" );
 
@@ -61,8 +64,20 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
-        loader.loadWithDependencies( loader.getSchema( "nis" ), registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
+        
+        errors = loader.loadWithDependencies( loader.getSchema( "nis" ), registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
     }
 
     

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -22,16 +22,19 @@
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 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.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
+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.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -72,7 +75,13 @@
         extractor.extractOrCopy();
         loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+        
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
     }
     
     

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -23,6 +23,8 @@
 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,6 +35,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 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.loader.ldif.JarLdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -65,11 +68,18 @@
      * Initializes the global registries.
      * @throws javax.naming.NamingException if there is a failure loading the schema
      */
-    @BeforeClass public static void init() throws Exception
+    @BeforeClass 
+    public static void init() throws Exception
     {
         registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
     }
 
 

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -24,6 +24,8 @@
 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,6 +36,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 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.loader.ldif.JarLdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -63,11 +66,18 @@
      * Initializes the global registries.
      * @throws javax.naming.NamingException if there is a failure loading the schema
      */
-    @BeforeClass public static void init() throws Exception
+    @BeforeClass 
+    public static void init() throws Exception
     {
         registries = new Registries();
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
         
         OBJECT_CLASS = registries.getAttributeTypeRegistry().lookup( "objectClass" );
     }

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -20,30 +20,34 @@
 package org.apache.directory.server.core.subtree;
 
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.normalization.FilterNormalizingVisitor;
-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.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.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.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
+import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 
 
 
@@ -61,7 +65,8 @@
     static AttributeTypeRegistry attributeRegistry;
     static ConcreteNameComponentNormalizer ncn;
 
-    private static void init() throws Exception
+    @BeforeClass
+    public static void init() throws Exception
     {
     	String workingDirectory = System.getProperty( "workingDirectory" );
 
@@ -77,7 +82,13 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
     	
         attributeRegistry = registries.getAttributeTypeRegistry();
         
@@ -101,13 +112,6 @@
     }
 
     
-    @BeforeClass
-    public static void setUp() throws Exception
-    {
-        init();
-    }
-
-
     @AfterClass
     public static void tearDown() throws Exception
     {

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -20,30 +20,31 @@
 package org.apache.directory.server.core.schema;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.commons.lang.NotImplementedException;
 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.comparators.SerializableComparator;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
-import org.apache.directory.shared.ldap.schema.registries.Schema;
 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.loader.ldif.LdifSchemaLoader;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-
-import javax.naming.NamingException;
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 
 /**
  * Tests the partition schema loader.
@@ -90,18 +91,14 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
         
-        // run referential integrity tests
-        List<Throwable> errors = registries.checkRefInteg();
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
         
-        if ( !errors.isEmpty() )
+        if ( errors.size() != 0 )
         {
-            NamingException e = new NamingException();
-            e.setRootCause( errors.get( 0 ) );
-            throw e;
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
         }
-
+        
         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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -20,20 +20,20 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.After;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+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;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexEntry;
-import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -41,10 +41,12 @@
 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.loader.ldif.LdifSchemaLoader;
-
-import java.io.File;
-import java.io.IOException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
 
 /**
@@ -77,7 +79,13 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         Registries registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -20,24 +20,27 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
-
-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.schema.loader.ldif.LdifSchemaLoader;
+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.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.loader.ldif.LdifSchemaLoader;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 
 /**
  * Test cases for JdbmMasterTable.
@@ -73,7 +76,13 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         Registries registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         attributeRegistry = registries.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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -20,56 +20,59 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.slf4j.Logger; 
-import org.slf4j.LoggerFactory;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.BeforeClass;
-import org.junit.Test;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.naming.directory.Attributes;
+
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
-import org.apache.directory.server.xdbm.IndexNotFoundException;
-import org.apache.directory.server.xdbm.IndexEntry;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerModification;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
+import org.apache.directory.server.xdbm.IndexNotFoundException;
 import org.apache.directory.server.xdbm.tools.StoreUtils;
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerModification;
-import org.apache.directory.server.core.entry.DefaultServerAttribute;
-import org.apache.directory.server.core.entry.ServerAttribute;
-import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.csn.CsnFactory;
 import org.apache.directory.shared.ldap.cursor.Cursor;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
+import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+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.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.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
-import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
-import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
-
-import javax.naming.directory.Attributes;
-import java.lang.reflect.Method;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.UUID;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -107,7 +110,13 @@
         extractor.extractOrCopy();
         loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -28,6 +28,7 @@
 
 import java.io.File;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 
@@ -61,6 +62,7 @@
 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.loader.ldif.LdifSchemaLoader;
 import org.junit.After;
 import org.junit.Before;
@@ -103,7 +105,13 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
 
         defaultCSNFactory = new CsnFactory( 0 );
         

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -20,6 +20,8 @@
 package org.apache.directory.server.tools;
 
 
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.PrintWriter;
@@ -44,8 +46,6 @@
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmMasterTable;
-import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
-import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.shared.ldap.MultiException;
 import org.apache.directory.shared.ldap.cursor.Cursor;
@@ -53,9 +53,12 @@
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 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;
 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.Base64;
+import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 
 
@@ -99,12 +102,17 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         Registries registries = new Registries();
-        loader.loadAllEnabled( registries );
-        loader.loadWithDependencies( loader.getSchema( "collective" ), registries );
-        SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 
-        // run referential integrity tests
-        List<Throwable> errors = registries.checkRefInteg();
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
+
+        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        
+        SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 
         if ( !errors.isEmpty() )
         {

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=824528&r1=824527&r2=824528&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 Mon Oct 12 22:44:52 2009
@@ -20,19 +20,22 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore;
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
-import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.search.Evaluator;
 import org.apache.directory.server.xdbm.tools.StoreUtils;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -42,20 +45,18 @@
 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.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.loader.ldif.LdifSchemaLoader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -94,8 +95,21 @@
         extractor.extractOrCopy();
         LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         registries = new Registries();
-        loader.loadAllEnabled( registries );
-        loader.loadWithDependencies( loader.getSchema( "collective" ), registries );
+
+        List<Throwable> errors = loader.loadAllEnabled( registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
+
+        errors = loader.loadWithDependencies( loader.getSchema( "collective" ), registries, true );
+        
+        if ( errors.size() != 0 )
+        {
+            fail( "Schema load failed : " + ExceptionUtils.printErrors( errors ) );
+        }
+
         SerializableComparator.setRegistry( registries.getComparatorRegistry() );
 
         attributeRegistry = registries.getAttributeTypeRegistry();



Mime
View raw message