directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r985668 - in /directory/shared/trunk: ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/ ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/
Date Sun, 15 Aug 2010 13:06:17 GMT
Author: kayyagari
Date: Sun Aug 15 13:06:16 2010
New Revision: 985668

URL: http://svn.apache.org/viewvc?rev=985668&view=rev
Log:
o fixed an issue with loading disabled schema
o updated tests

Modified:
    directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
    directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java

Modified: directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java?rev=985668&r1=985667&r2=985668&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
(original)
+++ directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
Sun Aug 15 13:06:16 2010
@@ -31,9 +31,8 @@ import java.io.File;
 import java.io.IOException;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.junit.tools.Concurrent;
-import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
+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.ldif.extractor.impl.DefaultSchemaLdifExtractor;
@@ -43,7 +42,6 @@ import org.apache.directory.shared.ldap.
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.junit.runner.RunWith;
 
 
 /**
@@ -167,8 +165,8 @@ import org.junit.runner.RunWith;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith(ConcurrentJunitRunner.class)
-@Concurrent()
+//@RunWith(ConcurrentJunitRunner.class)
+//@Concurrent()
 public class SchemaManagerLoadTest
 {
     // A directory in which the ldif files will be stored
@@ -176,7 +174,7 @@ public class SchemaManagerLoadTest
 
     // The schema repository
     private static File schemaRepository;
-
+    
 
     @BeforeClass
     public static void setup() throws Exception
@@ -524,7 +522,11 @@ public class SchemaManagerLoadTest
         assertTrue( schemaManager.load( "system" ) );
         assertTrue( schemaManager.load( "core" ) );
         assertTrue( schemaManager.load( "cosine" ) );
-        assertTrue( schemaManager.load( "nis" ) );
+        assertFalse( schemaManager.load( "nis" ) );
+        
+        AttributeType at = schemaManager.getAttributeType( "uidNumber" );
+        // if nis schema was loaded then the at will not be null
+        assertNull( at );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
         assertEquals( 133, schemaManager.getAttributeTypeRegistry().size() );
@@ -676,6 +678,7 @@ public class SchemaManagerLoadTest
 
         assertEquals( 1, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );

Modified: directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java?rev=985668&r1=985667&r2=985668&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
(original)
+++ directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
Sun Aug 15 13:06:16 2010
@@ -543,7 +543,10 @@ public class DefaultSchemaManager implem
         // Load the schemas
         for ( Schema schema : schemas )
         {
-            if ( !load( clonedRegistries, schema ) && ( !errors.isEmpty() ) )
+            boolean singleSchemaLoaded = load( clonedRegistries, schema );
+
+            // return false if the schema was not loaded in the first place
+            if ( !singleSchemaLoaded )
             {
                 return false;
             }



Mime
View raw message