directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r806835 - in /directory: apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ shared/branches/s...
Date Sat, 22 Aug 2009 10:31:20 GMT
Author: elecharny
Date: Sat Aug 22 10:31:19 2009
New Revision: 806835

URL: http://svn.apache.org/viewvc?rev=806835&view=rev
Log:
Fixed the tests to use the new Normalizers
Many other small fixes

Modified:
    directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
    directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
    directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
Sat Aug 22 10:31:19 2009
@@ -267,7 +267,7 @@
             }
         };
         
-        mr.normalizer = new Normalizer()
+        mr.normalizer = new Normalizer( "1.1.1" )
         {
             // The serial UID
             private static final long serialVersionUID = 1L;
@@ -380,7 +380,7 @@
             }
         };
         
-        mr.normalizer = new Normalizer()
+        mr.normalizer = new Normalizer( "1.1.1" )
         {
             // The serial UID
             private static final long serialVersionUID = 1L;

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
Sat Aug 22 10:31:19 2009
@@ -81,7 +81,7 @@
         mr = new TestServerEntryUtils.MR( "1.1.2.1" );
         mr.syntax = s;
         mr.comparator = new ByteArrayComparator();
-        mr.normalizer = new Normalizer()
+        mr.normalizer = new Normalizer( "1.1.1" )
         {
             private static final long serialVersionUID = 1L;
             

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=806835&r1=806834&r2=806835&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
Sat Aug 22 10:31:19 2009
@@ -37,6 +37,7 @@
 import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
@@ -84,24 +85,32 @@
         
         oids = new HashMap<String, OidNormalizer>();
 
-        oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "ou", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() )
);
-    
+        // DC normalizer
+        OidNormalizer dcOidNormalizer = new OidNormalizer( "dc",
+            new DeepTrimToLowerNormalizer( SchemaConstants.DOMAIN_COMPONENT_AT_OID ) );
+        
+        oids.put( "dc", dcOidNormalizer );
+        oids.put( "domaincomponent", dcOidNormalizer );
+        oids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+
+        // OU normalizer
+        OidNormalizer ouOidNormalizer = new OidNormalizer( "ou",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OU_AT_OID ) );
+        
+        oids.put( "ou", ouOidNormalizer );
+        oids.put( "organizationalUnitName",ouOidNormalizer );
+        oids.put( "2.5.4.11", ouOidNormalizer );
     
         // Another map where we store OIDs instead of names.
         oidOids = new HashMap<String, OidNormalizer>();
 
-        oidOids.put( "dc", new OidNormalizer( "0.9.2342.19200300.100.1.25", new DeepTrimToLowerNormalizer()
) );
-        oidOids.put( "domaincomponent", new OidNormalizer( "0.9.2342.19200300.100.1.25",
new DeepTrimToLowerNormalizer() ) );
-        oidOids.put( "0.9.2342.19200300.100.1.25", 
-            new OidNormalizer( "0.9.2342.19200300.100.1.25", new DeepTrimToLowerNormalizer()
) );
-        oidOids.put( "ou", new OidNormalizer( "2.5.4.11", new DeepTrimToLowerNormalizer()
) );
-        oidOids.put( "organizationalUnitName", new OidNormalizer( "2.5.4.11", new DeepTrimToLowerNormalizer()
) );
-        oidOids.put( "2.5.4.11", new OidNormalizer( "2.5.4.11", new DeepTrimToLowerNormalizer()
) );
+        oidOids.put( "dc", dcOidNormalizer );
+        oidOids.put( "domaincomponent", dcOidNormalizer );
+        oidOids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+
+        oidOids.put( "ou", ouOidNormalizer );
+        oidOids.put( "organizationalUnitName",ouOidNormalizer );
+        oidOids.put( "2.5.4.11", ouOidNormalizer );
     }
 
     

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
Sat Aug 22 10:31:19 2009
@@ -35,6 +35,7 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
@@ -62,14 +63,28 @@
     @BeforeClass
     public static void setUp() throws Exception
     {
-        oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "ou", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() )
);
-        oids.put( "objectclass", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.0", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer()
) );
+        // DC normalizer
+        OidNormalizer dcOidNormalizer = new OidNormalizer( "dc",
+            new DeepTrimToLowerNormalizer( SchemaConstants.DOMAIN_COMPONENT_AT_OID ) );
+        
+        oids.put( "dc", dcOidNormalizer );
+        oids.put( "domaincomponent", dcOidNormalizer );
+        oids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+
+        // OU normalizer
+        OidNormalizer ouOidNormalizer = new OidNormalizer( "ou",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OU_AT_OID ) );
+        
+        oids.put( "ou", ouOidNormalizer );
+        oids.put( "organizationalUnitName",ouOidNormalizer );
+        oids.put( "2.5.4.11", ouOidNormalizer );
+        
+        // ObjectClass normalizer
+        OidNormalizer objectClassOidNormalizer = new OidNormalizer( "objectClass",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OBJECT_CLASS_AT_OID ) );
+        
+        oids.put( "objectclass", objectClassOidNormalizer );
+        oids.put( "2.5.4.0", objectClassOidNormalizer );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
Sat Aug 22 10:31:19 2009
@@ -36,6 +36,7 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
@@ -61,14 +62,29 @@
     @BeforeClass
     public static void setUp() throws Exception
     {
-        oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "ou", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() )
);
-        oids.put( "objectclass", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.0", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer()
) );
+        // DC normalizer
+        OidNormalizer dcOidNormalizer = new OidNormalizer( "dc",
+            new DeepTrimToLowerNormalizer( SchemaConstants.DOMAIN_COMPONENT_AT_OID ) );
+        
+        oids.put( "dc", dcOidNormalizer );
+        oids.put( "domaincomponent", dcOidNormalizer );
+        oids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+        
+        
+        // OU normalizer
+        OidNormalizer ouOidNormalizer = new OidNormalizer( "ou",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OU_AT_OID ) );
+        
+        oids.put( "ou", ouOidNormalizer );
+        oids.put( "organizationalUnitName", ouOidNormalizer );
+        oids.put( "2.5.4.11", ouOidNormalizer );
+
+        // ObjectClass normalizer
+        OidNormalizer objectClassOidNormalizer = new OidNormalizer( "objectClass",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OBJECT_CLASS_AT_OID ) );
+        
+        oids.put( "objectclass", objectClassOidNormalizer );
+        oids.put( "2.5.4.0", objectClassOidNormalizer );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
Sat Aug 22 10:31:19 2009
@@ -46,6 +46,7 @@
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.controls.subEntry.SubEntryControlCodec;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.InternalMessage;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -74,14 +75,29 @@
     @Before
     public void setUp() throws Exception
     {
-        oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "ou", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() )
);
-        oids.put( "objectclass", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.0", new OidNormalizer( "objectclass", new DeepTrimToLowerNormalizer()
) );
+        // DC normalizer
+        OidNormalizer dcOidNormalizer = new OidNormalizer( "dc",
+            new DeepTrimToLowerNormalizer( SchemaConstants.DOMAIN_COMPONENT_AT_OID ) );
+        
+        oids.put( "dc", dcOidNormalizer );
+        oids.put( "domaincomponent", dcOidNormalizer );
+        oids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+        
+        
+        // OU normalizer
+        OidNormalizer ouOidNormalizer = new OidNormalizer( "ou",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OU_AT_OID ) );
+        
+        oids.put( "ou", ouOidNormalizer );
+        oids.put( "organizationalUnitName", ouOidNormalizer );
+        oids.put( "2.5.4.11", ouOidNormalizer );
+
+        // ObjectClass normalizer
+        OidNormalizer objectClassOidNormalizer = new OidNormalizer( "objectClass",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OBJECT_CLASS_AT_OID ) );
+        
+        oids.put( "objectclass", objectClassOidNormalizer );
+        oids.put( "2.5.4.0", objectClassOidNormalizer );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
Sat Aug 22 10:31:19 2009
@@ -306,7 +306,7 @@
         csv.set(  "  This is    a   TEST  " );
         assertFalse( csv.isNormalized() );
         
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         
         assertEquals( "this is a test", csv.getNormalizedValue() );
         assertTrue( csv.isNormalized() );
@@ -332,7 +332,7 @@
         csv.set(  "  This is    a   TEST  " );
         assertFalse( csv.isNormalized() );
         
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         
         assertEquals( "this is a test", csv.getNormalizedValue() );
         assertTrue( csv.isNormalized() );
@@ -341,7 +341,7 @@
         assertEquals( "this is a test", csv.getNormalizedValue() );
         assertFalse( csv.isNormalized() );
 
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         csv.clear();
         assertFalse( csv.isNormalized() );
     }
@@ -360,7 +360,7 @@
         csv.set(  "  This is    a   TEST  " );
         assertEquals( "  This is    a   TEST  ", csv.getNormalizedValue() );
         
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         
         assertEquals( "this is a test", csv.getNormalizedValue() );
 
@@ -383,7 +383,7 @@
         csv.set(  "  This is    a   TEST  " );
         assertEquals( "  This is    a   TEST  ", csv.getNormalizedValueCopy() );
         
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         
         assertEquals( "this is a test", csv.getNormalizedValueCopy() );
 
@@ -401,17 +401,17 @@
     {
         ClientStringValue csv = new ClientStringValue();
 
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         assertEquals( null, csv.getNormalizedValue() );
         
         csv.set( "" );
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         assertEquals( "", csv.getNormalizedValue() );
 
         csv.set(  "  This is    a   TEST  " );
         assertEquals( "  This is    a   TEST  ", csv.getNormalizedValue() );
         
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         
         assertEquals( "this is a test", csv.getNormalizedValue() );
     }
@@ -453,7 +453,7 @@
         // Now check that the equals method works on normalized values.
         csv1.set(  "  This is    a TEST   " );
         csv2.set( "this is a test" );
-        csv1.normalize( new DeepTrimToLowerNormalizer() );
+        csv1.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         assertEquals( 0, csv1.compareTo( csv2 ) );
         
         csv1.set( "a" );
@@ -489,7 +489,7 @@
         
         assertEquals( csv, csv1 );
         
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         
         assertNotSame( csv, csv1 );
     }
@@ -515,7 +515,7 @@
         // Now check that the equals method works on normalized values.
         csv1.set(  "  This is    a TEST   " );
         csv2.set( "this is a test" );
-        csv1.normalize( new DeepTrimToLowerNormalizer() );
+        csv1.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         assertEquals( csv1, csv2 );
     }
 
@@ -549,7 +549,7 @@
     {
         ClientStringValue csv = new ClientStringValue( "TEST");
         csv.setNormalized( true );
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
         csv.isValid( new Ia5StringSyntaxChecker() );
 
         ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
@@ -589,7 +589,7 @@
         ClientStringValue csv = new ClientStringValue( "  " );
         csv.setNormalized( true );
         csv.isValid( new Ia5StringSyntaxChecker() );
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
 
         ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
          assertNotSame( csv, csvSer );
@@ -609,7 +609,7 @@
         ClientStringValue csv = new ClientStringValue( null );
         csv.setNormalized( true );
         csv.isValid( new Ia5StringSyntaxChecker() );
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
 
         ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
          assertNotSame( csv, csvSer );
@@ -629,7 +629,7 @@
         ClientStringValue csv = new ClientStringValue( "" );
         csv.setNormalized( true );
         csv.isValid( new Ia5StringSyntaxChecker() );
-        csv.normalize( new DeepTrimToLowerNormalizer() );
+        csv.normalize( new DeepTrimToLowerNormalizer( "1.1.1" ) );
 
         ClientStringValue csvSer = deserializeValue( serializeValue( csv ) );
          assertNotSame( csv, csvSer );

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
Sat Aug 22 10:31:19 2009
@@ -42,6 +42,7 @@
 import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -177,13 +178,21 @@
 
         oids = new HashMap<String, OidNormalizer>();
 
-        oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-
-        oids.put( "ou", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() )
);
+        // DC normalizer
+        OidNormalizer dcOidNormalizer = new OidNormalizer( "dc",
+            new DeepTrimToLowerNormalizer( SchemaConstants.DOMAIN_COMPONENT_AT_OID ) );
+        
+        oids.put( "dc", dcOidNormalizer );
+        oids.put( "domaincomponent", dcOidNormalizer );
+        oids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+
+        // OU normalizer
+        OidNormalizer ouOidNormalizer = new OidNormalizer( "ou",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OU_AT_OID ) );
+        
+        oids.put( "ou", ouOidNormalizer );
+        oids.put( "organizationalUnitName", ouOidNormalizer );
+        oids.put( "2.5.4.11", ouOidNormalizer );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=806835&r1=806834&r2=806835&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
Sat Aug 22 10:31:19 2009
@@ -41,6 +41,7 @@
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapName;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.LdapDnParser;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -77,25 +78,32 @@
     {
         oids = new HashMap<String, OidNormalizer>();
 
-        oids.put( "dc", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "domaincomponent", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "dc", new DeepTrimToLowerNormalizer()
) );
-
-        oids.put( "ou", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
-        oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer()
) );
-        oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() )
);
+        // DC normalizer
+        OidNormalizer dcOidNormalizer = new OidNormalizer( "dc",
+            new DeepTrimToLowerNormalizer( SchemaConstants.DOMAIN_COMPONENT_AT_OID ) );
+        
+        oids.put( "dc", dcOidNormalizer );
+        oids.put( "domaincomponent", dcOidNormalizer );
+        oids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+
+        // OU normalizer
+        OidNormalizer ouOidNormalizer = new OidNormalizer( "ou",
+            new DeepTrimToLowerNormalizer( SchemaConstants.OU_AT_OID ) );
+        
+        oids.put( "ou", ouOidNormalizer );
+        oids.put( "organizationalUnitName", ouOidNormalizer );
+        oids.put( "2.5.4.11", ouOidNormalizer );
 
         // Another map where we store OIDs instead of names.
         oidOids = new HashMap<String, OidNormalizer>();
 
-        oidOids.put( "dc", new OidNormalizer( "0.9.2342.19200300.100.1.25", new DeepTrimToLowerNormalizer()
) );
-        oidOids.put( "domaincomponent", new OidNormalizer( "0.9.2342.19200300.100.1.25",
-            new DeepTrimToLowerNormalizer() ) );
-        oidOids.put( "0.9.2342.19200300.100.1.25", new OidNormalizer( "0.9.2342.19200300.100.1.25",
-            new DeepTrimToLowerNormalizer() ) );
-        oidOids.put( "ou", new OidNormalizer( "2.5.4.11", new DeepTrimToLowerNormalizer()
) );
-        oidOids.put( "organizationalUnitName", new OidNormalizer( "2.5.4.11", new DeepTrimToLowerNormalizer()
) );
-        oidOids.put( "2.5.4.11", new OidNormalizer( "2.5.4.11", new DeepTrimToLowerNormalizer()
) );
+        oidOids.put( "dc", dcOidNormalizer );
+        oidOids.put( "domaincomponent", dcOidNormalizer );
+        oidOids.put( "0.9.2342.19200300.100.1.25", dcOidNormalizer );
+
+        oidOids.put( "ou", ouOidNormalizer );
+        oidOids.put( "organizationalUnitName", ouOidNormalizer );
+        oidOids.put( "2.5.4.11", ouOidNormalizer );
     }
 
 



Mime
View raw message