directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r810586 - /directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
Date Wed, 02 Sep 2009 16:07:25 GMT
Author: elecharny
Date: Wed Sep  2 16:07:25 2009
New Revision: 810586

URL: http://svn.apache.org/viewvc?rev=810586&view=rev
Log:
LdapDN must be normalized before a schema check

Modified:
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java

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=810586&r1=810585&r2=810586&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
Wed Sep  2 16:07:25 2009
@@ -31,6 +31,7 @@
 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;
@@ -480,8 +481,9 @@
     @Test
     public void testPreventRdnChangeOnModifyRemoveAttribute() throws Exception
     {
+        Map<String, OidNormalizer> oidNormalizers = registries.getAttributeTypeRegistry().getNormalizerMapping();
         ModificationOperation mod = ModificationOperation.REMOVE_ATTRIBUTE;
-        LdapDN name = new LdapDN( "ou=user,dc=example,dc=com" );
+        LdapDN name = new LdapDN( "ou=user,dc=example,dc=com" ).normalize( oidNormalizers
);
         AttributeType cnAt = registries.getAttributeTypeRegistry().lookup( "cn" );
         AttributeType ouAt = registries.getAttributeTypeRegistry().lookup( "ou" );
         AttributeType snAt = registries.getAttributeTypeRegistry().lookup( "sn" );
@@ -504,6 +506,7 @@
 
         // test success using more than one attribute for the Rdn but not modifying rdn attribute
         name = new LdapDN( "ou=users+cn=system users,dc=example,dc=com" );
+        name.normalize( oidNormalizers );
         SchemaChecker.preventRdnChangeOnModifyRemove( name, mod, 
             new DefaultServerAttribute( "sn", snAt, "does not matter" ), registries.getAttributeTypeRegistry()
);
 



Mime
View raw message