directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r818658 - in /directory: apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/...
Date Thu, 24 Sep 2009 23:23:58 GMT
Author: elecharny
Date: Thu Sep 24 23:23:57 2009
New Revision: 818658

URL: http://svn.apache.org/viewvc?rev=818658&view=rev
Log:
o Fixed the Comparator injected classes tests by adding the schema name and FQCN into the
generated LdapComparator SchemaObject

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.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/ComparatorSynchronizer.java?rev=818658&r1=818657&r2=818658&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
Thu Sep 24 23:23:57 2009
@@ -67,6 +67,8 @@
         
         if ( ( schemaName != null ) && isSchemaLoaded( name ) )
         {
+            comparator.setSchemaName( schemaName );
+
             comparatorRegistry.unregister( oid );
             comparatorRegistry.register( comparator );
             

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java?rev=818658&r1=818657&r2=818658&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
Thu Sep 24 23:23:57 2009
@@ -37,8 +37,6 @@
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 
-import jdbm.helper.IntegerComparator;
-
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
 import org.apache.directory.server.core.integ.Level;
@@ -50,6 +48,7 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.comparators.BooleanComparator;
 import org.apache.directory.shared.ldap.schema.comparators.StringComparator;
 import org.apache.directory.shared.ldap.schema.registries.ComparatorRegistry;
 import org.apache.directory.shared.ldap.schema.registries.MatchingRuleRegistry;
@@ -282,7 +281,7 @@
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         
         ModificationItem[] mods = new ModificationItem[1];
-        Attribute attr = new BasicAttribute( MetaSchemaConstants.M_FQCN_AT, IntegerComparator.class.getName()
);
+        Attribute attr = new BasicAttribute( MetaSchemaConstants.M_FQCN_AT, BooleanComparator.class.getName()
);
         mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
         getSchemaContext( service ).modifyAttributes( dn, mods );
 
@@ -293,7 +292,7 @@
             getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
 
         Class<?> clazz = getComparatorRegistry().lookup( OID ).getClass();
-        assertEquals( clazz, IntegerComparator.class );
+        assertEquals( clazz, BooleanComparator.class );
     }
 
 
@@ -306,7 +305,7 @@
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         
         Attributes mods = new BasicAttributes( true );
-        mods.put( MetaSchemaConstants.M_FQCN_AT, IntegerComparator.class.getName() );
+        mods.put( MetaSchemaConstants.M_FQCN_AT, BooleanComparator.class.getName() );
         getSchemaContext( service ).modifyAttributes( dn, DirContext.REPLACE_ATTRIBUTE, mods
);
 
         assertTrue( "comparator OID should still be present", 
@@ -316,7 +315,7 @@
             getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
 
         Class<?> clazz = getComparatorRegistry().lookup( OID ).getClass();
-        assertEquals( clazz, IntegerComparator.class );
+        assertEquals( clazz, BooleanComparator.class );
     }
     
 

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java?rev=818658&r1=818657&r2=818658&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java
Thu Sep 24 23:23:57 2009
@@ -231,6 +231,7 @@
         comparator = ( LdapComparator<?> ) clazz.newInstance();
         comparator.setOid( oid );
         injectRegistries( comparator, targetRegistries );
+        comparator.setFqcn( className );
         return comparator;
     }
     
@@ -274,8 +275,9 @@
         }
         
         String className = entry.get( MetaSchemaConstants.M_FQCN_AT ).get().getString();
-        return getLdapComparator( entry.get( MetaSchemaConstants.M_OID_AT ).getString(),

-            className, entry.get( MetaSchemaConstants.M_BYTECODE_AT ), targetRegistries );
+        String oid = entry.get( MetaSchemaConstants.M_OID_AT ).getString();
+        EntryAttribute byteCode = entry.get( MetaSchemaConstants.M_BYTECODE_AT ); 
+        return getLdapComparator( oid, className, byteCode, targetRegistries );
     }
     
     



Mime
View raw message