directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1051517 - in /directory/shared/branches/shared-AP: ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/ ldap/src/main/java/org/apache/directory/shared/ldap/schema/ ldap/src/main/java/org/apache/directory/shared/ld...
Date Tue, 21 Dec 2010 15:04:00 GMT
Author: elecharny
Date: Tue Dec 21 15:04:00 2010
New Revision: 1051517

URL: http://svn.apache.org/viewvc?rev=1051517&view=rev
Log:
o Fixed the failing tests following the addition of 4 ATs
o Fixed the schemaLoader which was incorrectly loading wrong ATs, as some checks were skipped

Modified:
    directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java
    directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
    directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
    directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
    directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java

Modified: directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java?rev=1051517&r1=1051516&r2=1051517&view=diff
==============================================================================
--- directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java
(original)
+++ directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java
Tue Dec 21 15:04:00 2010
@@ -153,14 +153,14 @@ public class SchemaManagerEnableDisableL
         assertEquals( 0, disabled.size() );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 425, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 429, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 122, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 667, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 671, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 12, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
@@ -198,14 +198,14 @@ public class SchemaManagerEnableDisableL
         assertNotNull( schemaManager.lookupAttributeTypeRegistry( "gecos" ) );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 452, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 456, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 49, schemaManager.getComparatorRegistry().size() );
         assertEquals( 49, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 49, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 135, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 68, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 73, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 710, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 714, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 13, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
@@ -238,14 +238,14 @@ public class SchemaManagerEnableDisableL
         }
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 425, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 429, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 122, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 667, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 671, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 12, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
@@ -290,14 +290,14 @@ public class SchemaManagerEnableDisableL
         assertNotNull( schemaManager.lookupAttributeTypeRegistry( "gecos" ) );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 489, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 493, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 49, schemaManager.getComparatorRegistry().size() );
         assertEquals( 49, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 49, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 146, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 68, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 73, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 758, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 762, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 14, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "samba" ) );

Modified: directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java?rev=1051517&r1=1051516&r2=1051517&view=diff
==============================================================================
--- directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
(original)
+++ directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
Tue Dec 21 15:04:00 2010
@@ -284,14 +284,14 @@ public class SchemaManagerLoadTest
         assertTrue( schemaManager.load( "apache" ) );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 147, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 151, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 43, schemaManager.getComparatorRegistry().size() );
         assertEquals( 43, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 43, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 53, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 62, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 66, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 309, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 313, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );

Modified: directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java?rev=1051517&r1=1051516&r2=1051517&view=diff
==============================================================================
--- directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
(original)
+++ directory/shared/branches/shared-AP/ldap-schema/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
Tue Dec 21 15:04:00 2010
@@ -170,14 +170,14 @@ public class SchemaManagerLoadWithDepsTe
         schemaManager.loadWithDeps( "apache" );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 147, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 151, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 43, schemaManager.getComparatorRegistry().size() );
         assertEquals( 43, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 43, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 53, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 62, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 66, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 309, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 313, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
@@ -254,14 +254,14 @@ public class SchemaManagerLoadWithDepsTe
         schemaManager.loadWithDeps( "other" );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 178, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 182, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 66, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 363, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 367, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 5, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );

Modified: directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java?rev=1051517&r1=1051516&r2=1051517&view=diff
==============================================================================
--- directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
(original)
+++ directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
Tue Dec 21 15:04:00 2010
@@ -539,7 +539,7 @@ public class AttributeType extends Abstr
     /**
      * Check the constraints for the Usage field.
      */
-    private void checkUsage( List<Throwable> errors )
+    public void checkUsage( List<Throwable> errors )
     {
         // Check that the AT usage is the same that its superior
         if ( ( superior != null ) && ( usage != superior.getUsage() ) )
@@ -569,7 +569,7 @@ public class AttributeType extends Abstr
     /**
      * Check the constraints for the Collective field.
      */
-    private void checkCollective( List<Throwable> errors )
+    public void checkCollective( List<Throwable> errors )
     {
         if ( ( superior != null ) && superior.isCollective() )
         {

Modified: directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=1051517&r1=1051516&r2=1051517&view=diff
==============================================================================
--- directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-AP/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Tue Dec 21 15:04:00 2010
@@ -1071,6 +1071,13 @@ public class Registries implements Schem
                 if ( !processed.contains( superiorOid ) )
                 {
                     resolveRecursive( superior, processed, errors );
+                    
+                    // Check the USAGE
+                    attributeType.checkUsage( errors );
+
+                    // Check the COLLECTIVE element
+                    attributeType.checkCollective( errors );
+
                     processed.add( attributeType.getOid() );
                 }
                 else



Mime
View raw message