directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1084130 - in /directory: apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core...
Date Tue, 22 Mar 2011 10:58:37 GMT
Author: elecharny
Date: Tue Mar 22 10:58:36 2011
New Revision: 1084130

URL: http://svn.apache.org/viewvc?rev=1084130&view=rev
Log:
o Moved the NameComponentNormlizer to the normalizers package
o Don't use the DnParser anymore in tests

Added:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/NameComponentNormalizer.java
      - copied, changed from r1083790, directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/NameComponentNormalizer.java
Removed:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/NameComponentNormalizer.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/SimpleNameComponentNormalizer.java
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
    directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
    directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/SingleFileLdifPartitionTest.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/FilterNormalizingVisitor.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
    directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g
    directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItemChecker.g
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnParser.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Tue Mar 22 10:58:36 2011
@@ -53,10 +53,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Tue Mar 22 10:58:36 2011
@@ -45,8 +45,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java Tue Mar 22 10:58:36 2011
@@ -36,9 +36,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.PresenceNode;
 import org.apache.directory.shared.ldap.model.filter.SimpleNode;
 import org.apache.directory.shared.ldap.model.filter.SubstringNode;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Tue Mar 22 10:58:36 2011
@@ -51,10 +51,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.apache.directory.shared.ldap.model.name.Ava;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Tue Mar 22 10:58:36 2011
@@ -44,10 +44,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.FilterParser;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.registries.AbstractSchemaLoader;
 import org.apache.directory.shared.ldap.model.schema.registries.Registries;
 import org.apache.directory.shared.ldap.model.schema.registries.Schema;

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java Tue Mar 22 10:58:36 2011
@@ -29,13 +29,10 @@ import java.text.ParseException;
 
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
-import org.apache.directory.shared.ldap.model.filter.EqualityNode;
-import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.apache.directory.shared.ldap.model.filter.*;
-import org.apache.directory.shared.ldap.model.filter.PresenceNode;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schemaloader.JarLdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
 import org.apache.directory.shared.util.exception.Exceptions;

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java Tue Mar 22 10:58:36 2011
@@ -57,10 +57,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.FilterParser;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schemaextractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/SingleFileLdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/SingleFileLdifPartitionTest.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/SingleFileLdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/SingleFileLdifPartitionTest.java Tue Mar 22 10:58:36 2011
@@ -70,10 +70,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.ldif.LdifReader;
 import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schemaextractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/FilterNormalizingVisitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/FilterNormalizingVisitor.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/FilterNormalizingVisitor.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/FilterNormalizingVisitor.java Tue Mar 22 10:58:36 2011
@@ -27,19 +27,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.StringValue;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.filter.AndNode;
-import org.apache.directory.shared.ldap.model.filter.BranchNode;
-import org.apache.directory.shared.ldap.model.filter.ExprNode;
-import org.apache.directory.shared.ldap.model.filter.ExtensibleNode;
 import org.apache.directory.shared.ldap.model.filter.*;
-import org.apache.directory.shared.ldap.model.filter.LeafNode;
-import org.apache.directory.shared.ldap.model.filter.NotNode;
-import org.apache.directory.shared.ldap.model.filter.PresenceNode;
-import org.apache.directory.shared.ldap.model.filter.SimpleNode;
-import org.apache.directory.shared.ldap.model.filter.SubstringNode;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java Tue Mar 22 10:58:36 2011
@@ -40,9 +40,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.apache.directory.shared.ldap.model.filter.FilterParser;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.normalizers.ConcreteNameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.UuidSyntaxChecker;
 import org.apache.directory.shared.ldap.schemaextractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java Tue Mar 22 10:58:36 2011
@@ -1228,7 +1228,7 @@ public class DnTest
                 {'C', 'N', ' ', '=', ' ', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', ' ', 'L', (byte) 0xc3,
                         (byte) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y'});
 
-        Dn name = DnParser.getNameParser().parse( dn );
+        Dn name = new Dn( dn );
 
         assertEquals( dn, ( name ).getName() );
         assertEquals( "cn=Emmanuel  L\u00E9charny", ( name ).getNormName() );

Modified: directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g (original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g Tue Mar 22 10:58:36 2011
@@ -39,7 +39,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.LeafNode;
 import org.apache.directory.shared.ldap.model.filter.EqualityNode;
 import org.apache.directory.shared.ldap.model.filter.FilterParser;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.model.subtree.SubtreeSpecificationModifier;
 import org.apache.directory.shared.util.ComponentsMonitor;

Modified: directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItemChecker.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItemChecker.g?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItemChecker.g (original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItemChecker.g Tue Mar 22 10:58:36 2011
@@ -24,7 +24,7 @@ header
 package org.apache.directory.shared.ldap.aci;
 
 
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 }
 
 

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java (original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java Tue Mar 22 10:58:36 2011
@@ -25,8 +25,8 @@ import java.io.StringReader;
 import java.text.ParseException;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.model.schema.normalizers.NameComponentNormalizer;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java Tue Mar 22 10:58:36 2011
@@ -50,8 +50,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.ldap.model.name.DnParser;
-import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.util.Base64;
 import org.apache.directory.shared.util.Chars;
 import org.apache.directory.shared.util.Strings;
@@ -543,14 +541,11 @@ public class LdifReader implements Itera
         }
 
         // Check that the Dn is valid. If not, an exception will be thrown
-        try
-        {
-            DnParser.parseInternal(dn, new ArrayList<Rdn>());
-        }
-        catch ( LdapInvalidDnException ine )
+        if ( !Dn.isValid( dn ) )
         {
-            LOG.error( I18n.err( I18n.ERR_12017_INVALID_DN, dn ) );
-            throw new LdapLdifException( ine.getMessage() );
+            String message = I18n.err( I18n.ERR_12017_INVALID_DN, dn );
+            LOG.error( message );
+            throw new LdapLdifException( message );
         }
 
         return dn;

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnParser.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnParser.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnParser.java Tue Mar 22 10:58:36 2011
@@ -106,6 +106,7 @@ public enum DnParser
     public static boolean validateInternal( String name )
     {
         Dn dn = new Dn();
+        
         try
         {
             parseInternal( name, dn.rdns );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ConcreteNameComponentNormalizer.java Tue Mar 22 10:58:36 2011
@@ -25,7 +25,6 @@ import java.io.UnsupportedEncodingExcept
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.model.entry.BinaryValue;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;

Copied: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/NameComponentNormalizer.java (from r1083790, directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/NameComponentNormalizer.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/NameComponentNormalizer.java?p2=directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/NameComponentNormalizer.java&p1=directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/NameComponentNormalizer.java&r1=1083790&r2=1084130&rev=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/NameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/NameComponentNormalizer.java Tue Mar 22 10:58:36 2011
@@ -18,7 +18,7 @@
  *  
  */
 
-package org.apache.directory.shared.ldap.model.name;
+package org.apache.directory.shared.ldap.model.schema.normalizers;
 
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java Tue Mar 22 10:58:36 2011
@@ -20,17 +20,12 @@
 package org.apache.directory.shared.ldap.model.name;
 
 
-import java.util.ArrayList;
-
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.name.DnParser;
-import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.fail;
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
 
 /**
@@ -46,18 +41,10 @@ public class DnParserDIRSERVER_584_Test
    /**
     * Need this testa() to run first to mess up the state of the static parser.
     */
-    @Test
+    @Test( expected=LdapException.class )
     public void testa() throws Exception
    {
-       try
-       {
-           DnParser.parseInternal( "ou=test+testing", new ArrayList<Rdn>() );
-           fail( "should never get here" );
-       }
-       catch ( LdapException e )
-       {
-           // Nothing to do
-       }
+       new Dn( "ou=test+testing"  );
    }
 
 
@@ -68,6 +55,6 @@ public class DnParserDIRSERVER_584_Test
     @Test
     public void testb() throws Exception
    {
-       DnParser.parseInternal("ou=system", new ArrayList<Rdn>());
+       new Dn( "ou=system" );
    }
 }
\ No newline at end of file

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java?rev=1084130&r1=1084129&r2=1084130&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java Tue Mar 22 10:58:36 2011
@@ -44,16 +44,15 @@ import com.mycila.junit.concurrent.Concu
 @Concurrency()
 public class DnParserTest
 {
-    // CONSTRUCTOR functions --------------------------------------------------
     /**
      * test an empty Dn
      */
     @Test
     public void testLdapDNEmpty() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
+        Dn dn = new Dn( "" );
 
-        assertEquals( "", ( (Dn) dnParser.parse( "" ) ).getName() );
+        assertEquals( "", dn.getName() );
     }
 
 
@@ -63,10 +62,10 @@ public class DnParserTest
     @Test
     public void testLdapDNSimple() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
+        Dn dn = new Dn( "a = b" );
 
-        assertEquals( "a = b", ( (Dn) dnParser.parse( "a = b" ) ).getName() );
-        assertEquals( "a=b", ( (Dn) dnParser.parse( "a = b" ) ).getNormName() );
+        assertEquals( "a = b", dn.getName() );
+        assertEquals( "a=b", dn.getNormName() );
     }
 
 
@@ -76,8 +75,8 @@ public class DnParserTest
     @Test
     public void testLdapDNComposite() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a = b, c = d" );
+        Dn dn = new Dn( "a = b, c = d"  );
+
         assertEquals( "a=b,c=d", dn.getNormName() );
         assertEquals( "a = b, c = d", dn.getName() );
     }
@@ -89,8 +88,7 @@ public class DnParserTest
     @Test
     public void testLdapDNCompositeWithSpace() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a=b, a =b, a= b, a = b, a  =  b" );
+        Dn dn = new Dn( "a=b, a =b, a= b, a = b, a  =  b" );
         assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.getNormName() );
         assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
     }
@@ -103,8 +101,7 @@ public class DnParserTest
     @Test
     public void testLdapDNCompositeSepators() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a=b;c=d,e=f" );
+        Dn dn = new Dn( "a=b;c=d,e=f" );
         assertEquals( "a=b,c=d,e=f", dn.getNormName() );
         assertEquals( "a=b;c=d,e=f", dn.getName() );
     }
@@ -116,8 +113,7 @@ public class DnParserTest
     @Test
     public void testLdapDNSimpleMultivaluedAttribute() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a = b + c = d" );
+        Dn dn = new Dn( "a = b + c = d" );
         assertEquals( "a=b+c=d", dn.getNormName() );
         assertEquals( "a = b + c = d", dn.getName() );
     }
@@ -130,8 +126,7 @@ public class DnParserTest
     @Test
     public void testLdapDNCompositeMultivaluedAttribute() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a=b+c=d, e=f + g=h + i=j" );
+        Dn dn = new Dn( "a=b+c=d, e=f + g=h + i=j" );
         assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.getNormName() );
         assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() );
     }
@@ -143,8 +138,7 @@ public class DnParserTest
     @Test
     public void testLdapDNOidUpper() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "OID.12.34.56 = azerty" );
+        Dn dn = new Dn( "OID.12.34.56 = azerty" );
         assertEquals( "oid.12.34.56=azerty", dn.getNormName() );
         assertEquals( "OID.12.34.56 = azerty", dn.getName() );
     }
@@ -156,8 +150,7 @@ public class DnParserTest
     @Test
     public void testLdapDNOidLower() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "oid.12.34.56 = azerty" );
+        Dn dn = new Dn( "oid.12.34.56 = azerty" );
         assertEquals( "oid.12.34.56=azerty", dn.getNormName() );
         assertEquals( "oid.12.34.56 = azerty", dn.getName() );
     }
@@ -170,8 +163,7 @@ public class DnParserTest
     @Test
     public void testLdapDNOidWithoutPrefix() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "12.34.56 = azerty" );
+        Dn dn = new Dn( "12.34.56 = azerty" );
         assertEquals( "12.34.56=azerty", dn.getNormName() );
         assertEquals( "12.34.56 = azerty", dn.getName() );
     }
@@ -184,8 +176,7 @@ public class DnParserTest
     @Test
     public void testLdapDNCompositeOidWithoutPrefix() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "12.34.56 = azerty; 7.8 = test" );
+        Dn dn = new Dn( "12.34.56 = azerty; 7.8 = test" );
         assertEquals( "12.34.56=azerty,7.8=test", dn.getNormName() );
         assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() );
     }
@@ -197,12 +188,11 @@ public class DnParserTest
     @Test
     public void testLdapDNPairCharAttributeValue() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C3\\A9" );
+        Dn dn = new Dn( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C3\\A9" );
         assertEquals( "a=\\,=\\+\\<\\>#\\;\\\\\\\"\u00e9", dn.getNormName() );
         assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C3\\A9", dn.getName() );
 
-        dn = (Dn) dnParser.parse( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\u00e9" );
+        dn = new Dn( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\u00e9" );
         assertEquals( "a=\\,=\\+\\<\\>#\\;\\\\\\\"\u00e9", dn.getNormName() );
         assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\u00e9", dn.getName() );
     }
@@ -214,8 +204,7 @@ public class DnParserTest
     @Test
     public void testLdapDNHexStringAttributeValue() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a = #0010A0AAFF" );
+        Dn dn = new Dn( "a = #0010A0AAFF" );
         assertEquals( "a=#0010A0AAFF", dn.getNormName() );
         assertEquals( "a = #0010A0AAFF", dn.getName() );
     }
@@ -229,8 +218,7 @@ public class DnParserTest
     {
         try
         {
-            DnParser dnParser = DnParser.getNameParser();
-            dnParser.parse( "a=#zz" );
+            new Dn( "a=#zz" );
             fail();
         }
         catch ( LdapInvalidDnException ine )
@@ -246,12 +234,11 @@ public class DnParserTest
     @Test
     public void testLdapDNQuotedAttributeValue() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a = quoted \\\"value" );
+        Dn dn = new Dn( "a = quoted \\\"value" );
         assertEquals( "a=quoted \\\"value", dn.getNormName() );
         assertEquals( "a = quoted \\\"value", dn.getName() );
         
-        dn = (Dn) dnParser.parse( "cn=Mackie \\\"The Knife\\\" Messer" );
+        dn = new Dn( "cn=Mackie \\\"The Knife\\\" Messer" );
         assertEquals( "cn=Mackie \\\"The Knife\\\" Messer", dn.getNormName() );
         assertEquals( "cn=Mackie \\\"The Knife\\\" Messer", dn.getName() );
     }
@@ -263,8 +250,7 @@ public class DnParserTest
     @Test
     public void testLdapDNBackslashInAttributeValue() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "a = AC\\\\DC" );
+        Dn dn = new Dn( "a = AC\\\\DC" );
         assertEquals( "a=AC\\\\DC", dn.getNormName() );
         assertEquals( "a = AC\\\\DC", dn.getName() );
     }
@@ -276,8 +262,7 @@ public class DnParserTest
     @Test
     public void testNameToBytes() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn dn = (Dn) dnParser.parse( "cn = John, ou = People, OU = Marketing" );
+        Dn dn = new Dn( "cn = John, ou = People, OU = Marketing" );
 
         byte[] bytes = Dn.getBytes(dn);
 
@@ -293,8 +278,7 @@ public class DnParserTest
                 {'C', 'N', ' ', '=', ' ', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', ' ', 'L', (byte) 0xc3,
                         (byte) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y'});
 
-        DnParser dnParser = DnParser.getNameParser();
-        Dn name = (Dn) dnParser.parse( dn );
+        Dn name = new Dn( dn );
 
         assertEquals( dn, name.getName() );
         assertEquals( "cn=Emmanuel  L\u00e9charny", name.getNormName() );
@@ -307,8 +291,7 @@ public class DnParserTest
         String dn = Strings.utf8ToString(new byte[]
                 {'C', '=', ' ', 'E', (byte) 0xc3, (byte) 0xa9, 'c'});
 
-        DnParser dnParser = DnParser.getNameParser();
-        Dn name = (Dn) dnParser.parse( dn );
+        Dn name = new Dn( dn );
 
         assertEquals( dn, name.getName() );
         assertEquals( "c=E\u00e9c", name.getNormName() );
@@ -318,9 +301,7 @@ public class DnParserTest
     @Test
     public void testVsldapExtras() throws LdapException
     {
-        DnParser dnParser = DnParser.getNameParser();
-        Dn name = (Dn) dnParser
-            .parse( "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US" );
+        Dn name = new Dn( "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US" );
 
         assertEquals(
             "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US", name
@@ -331,34 +312,17 @@ public class DnParserTest
     }
 
 
-    // ~ Methods
-    // ----------------------------------------------------------------
-
-    /**
-     * Class under test for void DnParser()
-     *
-     * @throws LdapException
-     *             if anything goes wrong
-     */
-    public final void testDnParser()
-    {
-        DnParser parser = DnParser.getNameParser();
-
-        assertNotNull( parser );
-    }
-
-
     /**
      * Class under test for Name parse(String)
      *
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringEmpty() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
 
-        Dn nameEmpty = parser.parse( "" );
+        Dn nameEmpty = new Dn( "" );
 
         assertNotNull( nameEmpty );
     }
@@ -370,11 +334,10 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringNull() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameNull = parser.parse( null );
+        Dn nameNull = new Dn( (String)null );
 
         assertEquals( "Null Dn are legal : ", "", nameNull.toString() );
     }
@@ -386,18 +349,16 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC1779_1() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameRFC1779_1 = parser
-            .parse( "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US" );
+        Dn nameRFC1779_1 = new Dn( "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US" );
 
         assertEquals( "RFC1779_1 : ",
             "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US",
             ( (Dn) nameRFC1779_1 ).getName() );
         assertEquals( "RFC1779_1 : ", "cn=Marshall T. Rose,o=Dover Beach Consulting,l=Santa Clara,st=California,c=US",
-            nameRFC1779_1.toString() );
+            nameRFC1779_1.getNormName() );
     }
 
 
@@ -407,11 +368,10 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_1() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameRFC2253_1 = parser.parse( "CN=Steve Kille,O=Isode limited,C=GB" );
+        Dn nameRFC2253_1 = new Dn( "CN=Steve Kille,O=Isode limited,C=GB" );
 
         assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( (Dn) nameRFC2253_1 ).getName() );
     }
@@ -423,15 +383,14 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_2() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameRFC2253_2 = parser.parse( "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US" );
+        Dn nameRFC2253_2 = new Dn( "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US" );
 
         assertEquals( "RFC2253_2 : ", "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US",
             ( (Dn) nameRFC2253_2 ).getName() );
-        assertEquals( "RFC2253_2 : ", "cn=J. Smith+cn=Sales,o=Widget Inc.,c=US", nameRFC2253_2.toString() );
+        assertEquals( "RFC2253_2 : ", "cn=Sales+cn=J. Smith,o=Widget Inc.,c=US", nameRFC2253_2.getNormName() );
     }
 
 
@@ -441,15 +400,14 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_3() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameRFC2253_3 = parser.parse( "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB" );
+        Dn nameRFC2253_3 = new Dn( "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB" );
 
         assertEquals( "RFC2253_3 : ", "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB", ( (Dn) nameRFC2253_3 )
             .getName() );
-        assertEquals( "RFC2253_3 : ", "cn=L. Eagle,o=Sue\\, Grabbit and Runn,c=GB", nameRFC2253_3.toString() );
+        assertEquals( "RFC2253_3 : ", "cn=L. Eagle,o=Sue\\, Grabbit and Runn,c=GB", nameRFC2253_3.getNormName() );
     }
 
 
@@ -459,11 +417,10 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_4() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameRFC2253_4 = parser.parse( "CN=Before\\0DAfter,O=Test,C=GB" );
+        Dn nameRFC2253_4 = new Dn( "CN=Before\\0DAfter,O=Test,C=GB" );
         assertEquals( "RFC2253_4 : ", "CN=Before\\0DAfter,O=Test,C=GB", ( (Dn) nameRFC2253_4 ).getName() );
     }
 
@@ -474,11 +431,10 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_5() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameRFC2253_5 = parser.parse( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );
+        Dn nameRFC2253_5 = new Dn( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );
 
         assertEquals( "RFC2253_5 : ", "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB", ( (Dn) nameRFC2253_5 )
             .getName() );
@@ -491,11 +447,10 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_6() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
-
-        Dn nameRFC2253_6 = parser.parse( "SN=Lu\\C4\\8Di\\C4\\87" );
+        Dn nameRFC2253_6 = new Dn( "SN=Lu\\C4\\8Di\\C4\\87" );
 
         assertEquals( "RFC2253_6 : ", "SN=Lu\\C4\\8Di\\C4\\87", ( (Dn) nameRFC2253_6 ).getName() );
     }
@@ -507,13 +462,12 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseInvalidString()
     {
-        DnParser parser = DnParser.getNameParser();
-
         try
         {
-            parser.parse( "&#347;=&#347;rasulu,dc=example,dc=com" );
+            new Dn( "&#347;=&#347;rasulu,dc=example,dc=com" );
             fail( "the invalid name should never succeed in a parse" );
         }
         catch ( Exception e )
@@ -532,11 +486,11 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong on parse()
      */
+    @Test
     public final void testPreserveSpaceAfterEscape() throws LdapException
     {
-        DnParser parser = DnParser.getNameParser();
         String input = "ou=some test\\,  something else";
-        String result = parser.parse( input ).toString();
+        String result = new Dn( input ).toString();
         assertEquals( "ou=some test\\,  something else", result );
     }
 
@@ -546,10 +500,9 @@ public class DnParserTest
     {
         // '\' should be escaped as stated in RFC 2253
         String path = "windowsFilePath=C:\\\\cygwin";
-        DnParser parser = DnParser.getNameParser();
-        Dn result = parser.parse( path );
-        assertEquals( path, ( (Dn) result ).getName() );
-        assertEquals( "windowsfilepath=C:\\\\cygwin", ((Dn)result).getNormName() );
+        Dn result = new Dn( path );
+        assertEquals( path, result.getName() );
+        assertEquals( "windowsfilepath=C:\\\\cygwin", result.getNormName() );
     }
 
 
@@ -560,8 +513,7 @@ public class DnParserTest
             { 'c', 'n', '=', 0x4A, ( byte ) 0xC3, ( byte ) 0xA9, 0x72, ( byte ) 0xC3, ( byte ) 0xB4, 0x6D, 0x65 },
             "UTF-8" );
 
-        DnParser parser = DnParser.getNameParser();
-        String result = parser.parse( cn ).toString();
+        String result = new Dn( cn ).toString();
 
         assertEquals( "cn=J\u00e9r\u00f4me", result.toString() );
     }
@@ -575,8 +527,7 @@ public class DnParserTest
                 ( byte ) 0xC3, ( byte ) 0x9F, ( byte ) 0xC3, ( byte ) 0xA4, ( byte ) 0xC3, ( byte ) 0xB6,
                 ( byte ) 0xC3, ( byte ) 0xBC }, "UTF-8" );
 
-        DnParser parser = DnParser.getNameParser();
-        String result = parser.parse( cn ).toString();
+        String result = new Dn( cn ).toString();
 
         assertEquals( "cn=\u00C4\u00D6\u00DC\u00DF\u00E4\u00F6\u00FC", result.toString() );
     }
@@ -591,8 +542,7 @@ public class DnParserTest
                 ( byte ) 0xC3, ( byte ) 0x9C, ( byte ) 0xC3, ( byte ) 0xBC, ( byte ) 0xC4, ( byte ) 0x9E,
                 ( byte ) 0xC4, ( byte ) 0x9F }, "UTF-8" );
 
-        DnParser parser = DnParser.getNameParser();
-        String result = parser.parse( cn ).toString();
+        String result = new Dn( cn ).toString();
 
         assertEquals( "cn=\u0130\u0131\u015E\u015F\u00D6\u00F6\u00DC\u00FC\u011E\u011F", result.toString() );
     }
@@ -604,8 +554,7 @@ public class DnParserTest
         String cn = new String( new byte[] { 'c', 'n', '=', (byte)0xC3, (byte)0x84, 0x5C, 0x32, 0x42 }, "UTF-8" );
 
 
-        DnParser parser = DnParser.getNameParser();
-        String result = ((Dn)parser.parse( cn )).getNormName();
+        String result = new Dn( cn ).getNormName();
         
         assertEquals( "cn=\u00c4\\+", result );
     }
@@ -616,8 +565,7 @@ public class DnParserTest
     {
         String cn = new String( new byte[] { 'c', 'n', '=', (byte)0xC3, (byte)0x84, '\\', '+' }, "UTF-8" );
         
-        DnParser parser = DnParser.getNameParser();
-        String result = parser.parse( cn ).toString();
+        String result = new Dn( cn ).toString();
         
         assertEquals( "cn=\u00c4\\+", result );
     }
@@ -630,14 +578,14 @@ public class DnParserTest
      * @throws LdapException
      *             if anything goes wrong on parse()
      */
+    @Test
     public final void testNonEscapedChars()
     {
-        DnParser parser = DnParser.getNameParser();
         String input = "ou=ou+test";
 
         try
         {
-            parser.parse( input ).toString();
+            new Dn( input ).toString();
             fail( "Should never rech this point" );
         }
         catch ( LdapException ne )



Mime
View raw message