directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r411416 [2/3] - in /directory/branches/shared/optimization/ldap/src: main/antlr/ main/java/org/apache/directory/shared/ldap/codec/ main/java/org/apache/directory/shared/ldap/codec/add/ main/java/org/apache/directory/shared/ldap/codec/bind/ ...
Date Sat, 03 Jun 2006 10:07:54 GMT
Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/BaseSubtreeSpecification.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/BaseSubtreeSpecification.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/BaseSubtreeSpecification.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/BaseSubtreeSpecification.java Sat Jun  3 03:07:50 2006
@@ -18,11 +18,10 @@
 
 
 import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import java.util.Set;
 import java.util.Collections;
-import javax.naming.Name;
 
 
 /**
@@ -35,7 +34,7 @@
 public class BaseSubtreeSpecification implements SubtreeSpecification
 {
     /** the subtree base relative to the administration point */
-    private final Name base;
+    private final LdapDN base;
 
     /** the set of subordinates entries and their subordinates to exclude */
     private final Set chopBefore;
@@ -67,7 +66,7 @@
      */
     public BaseSubtreeSpecification()
     {
-        this.base = new LdapName();
+        this.base = new LdapDN();
 
         this.minBaseDistance = 0;
 
@@ -92,7 +91,7 @@
      */
     public BaseSubtreeSpecification(ExprNode refinement)
     {
-        this.base = new LdapName();
+        this.base = new LdapDN();
 
         this.minBaseDistance = 0;
 
@@ -114,7 +113,7 @@
      * @param base
      *            the base of the subtree relative to the administrative point
      */
-    public BaseSubtreeSpecification(Name base)
+    public BaseSubtreeSpecification( LdapDN base )
     {
         this.base = base;
 
@@ -147,7 +146,7 @@
      *            the set of subordinates entries and their subordinates to
      *            exclude
      */
-    public BaseSubtreeSpecification(Name base, int minBaseDistance, int maxBaseDistance, Set chopAfter, Set chopBefore)
+    public BaseSubtreeSpecification( LdapDN base, int minBaseDistance, int maxBaseDistance, Set chopAfter, Set chopBefore )
     {
         this( base, minBaseDistance, maxBaseDistance, chopAfter, chopBefore, null );
     }
@@ -174,8 +173,8 @@
      *            the filter expression only composed of objectClass attribute
      *            value assertions
      */
-    public BaseSubtreeSpecification(Name base, int minBaseDistance, int maxBaseDistance, Set chopAfter, Set chopBefore,
-        ExprNode refinement)
+    public BaseSubtreeSpecification( LdapDN base, int minBaseDistance, int maxBaseDistance, Set chopAfter, Set chopBefore,
+        ExprNode refinement )
     {
         this.base = base;
 
@@ -202,7 +201,7 @@
     // A C C E S S O R S
     // -----------------------------------------------------------------------
 
-    public Name getBase()
+    public LdapDN getBase()
     {
         return this.base;
     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecification.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecification.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecification.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecification.java Sat Jun  3 03:07:50 2006
@@ -18,9 +18,9 @@
 
 
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import java.util.Set;
-import javax.naming.Name;
 
 
 /**
@@ -49,7 +49,7 @@
      *         if the base is the administrative point - note that this Name is
      *         not Normalized according to matchingRules.
      */
-    Name getBase();
+    LdapDN getBase();
 
 
     /**

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java Sat Jun  3 03:07:50 2006
@@ -18,11 +18,10 @@
 
 
 import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import java.util.Set;
 import java.util.Collections;
-import javax.naming.Name;
 
 
 /**
@@ -37,7 +36,7 @@
 public class SubtreeSpecificationModifier
 {
     /** the subtree base relative to the administration point */
-    private Name base = new LdapName();
+    private LdapDN base = new LdapDN();
 
     /** the set of subordinates entries and their subordinates to exclude */
     private Set chopBefore = Collections.EMPTY_SET;
@@ -86,7 +85,7 @@
      * @param base
      *            subtree base relative to the administration point
      */
-    public void setBase( Name base )
+    public void setBase( LdapDN base )
     {
         this.base = base;
     }

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java (original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java Sat Jun  3 03:07:50 2006
@@ -26,7 +26,7 @@
 package org.apache.directory.shared.ldap.util;
 
 
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.*;
 import java.util.ArrayList;
@@ -390,7 +390,7 @@
      */
     public static Name getRelativeName( Name ancestor, Name descendant ) throws NamingException
     {
-        LdapName rdn = new LdapName( descendant.toString() );
+        LdapDN rdn = new LdapDN( descendant.toString() );
 
         if ( rdn.startsWith( ancestor ) )
         {

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java Sat Jun  3 03:07:50 2006
@@ -89,7 +89,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -210,7 +210,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java Sat Jun  3 03:07:50 2006
@@ -103,7 +103,7 @@
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry().toString() );
 
         Attributes attributes = addRequest.getAttributes();
 
@@ -522,7 +522,7 @@
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry().toString() );
 
         Attributes attributes = addRequest.getAttributes();
 
@@ -609,7 +609,7 @@
 
         // Check the decoded message
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry().toString() );
 
         Attributes attributes = addRequest.getAttributes();
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java Sat Jun  3 03:07:50 2006
@@ -90,7 +90,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -170,7 +170,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -281,7 +281,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "password", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() )
             .getSimple() ) );
@@ -355,7 +355,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
 
@@ -436,7 +436,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
+        assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "abcdef", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() )
@@ -744,7 +744,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication ) );
         assertEquals( "", StringTools.utf8ToString( ( ( SimpleAuthentication ) br.getAuthentication() ).getSimple() ) );
 
@@ -841,7 +841,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
 
@@ -903,7 +903,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );
@@ -970,7 +970,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );
@@ -1045,7 +1045,7 @@
 
         assertEquals( 1, message.getMessageId() );
         assertEquals( 3, br.getVersion() );
-        assertEquals( "", br.getName() );
+        assertEquals( "", br.getName().toString() );
         assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials ) );
         assertEquals( "", ( ( SaslCredentials ) br.getAuthentication() ).getMechanism() );
         assertEquals( "", StringTools.utf8ToString( ( ( SaslCredentials ) br.getAuthentication() ).getCredentials() ) );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java Sat Jun  3 03:07:50 2006
@@ -90,7 +90,7 @@
         CompareRequest compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "value", compareRequest.getAssertionValue().toString() );
 
@@ -312,7 +312,7 @@
         CompareRequest compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "", compareRequest.getAssertionValue().toString() );
 
@@ -385,7 +385,7 @@
         CompareRequest compareRequest = message.getCompareRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", compareRequest.getEntry().toString() );
         assertEquals( "test", compareRequest.getAttributeDesc() );
         assertEquals( "value", compareRequest.getAssertionValue().toString() );
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java Sat Jun  3 03:07:50 2006
@@ -84,7 +84,7 @@
         DelRequest delRequest = message.getDelRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
 
         // Check the length
         assertEquals( 0x27, message.computeLength() );
@@ -187,7 +187,7 @@
         DelRequest delRequest = message.getDelRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry().toString() );
 
         // Check the length
         assertEquals( 0x44, message.computeLength() );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java Sat Jun  3 03:07:50 2006
@@ -113,7 +113,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -208,7 +208,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 21, message.getMessageId() );
-        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject() );
+        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -325,7 +325,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject() );
+        assertEquals( "cn=Tori Amos,ou=playground,dc=apache,dc=org", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -459,7 +459,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -928,7 +928,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -1003,7 +1003,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 
@@ -1084,7 +1084,7 @@
         ModifyRequest modifyRequest = message.getModifyRequest();
 
         assertEquals( 49, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject().toString() );
 
         ArrayList modifications = modifyRequest.getModifications();
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java Sat Jun  3 03:07:50 2006
@@ -89,10 +89,10 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
-        assertEquals( "ou=system", modifyDNRequest.getNewSuperior() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
+        assertEquals( "ou=system", modifyDNRequest.getNewSuperior().toString() );
 
         // Check the length
         assertEquals( 0x48, message.computeLength() );
@@ -163,10 +163,10 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
-        assertEquals( "ou=system", modifyDNRequest.getNewSuperior() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
+        assertEquals( "ou=system", modifyDNRequest.getNewSuperior().toString() );
 
         // Check the Control
         List controls = message.getControls();
@@ -243,9 +243,9 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
 
         // Check the length
         assertEquals( 0x3D, message.computeLength() );
@@ -315,9 +315,9 @@
         ModifyDNRequest modifyDNRequest = message.getModifyDNRequest();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() );
+        assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry().toString() );
         assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
-        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
+        assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN().toString() );
 
         // Check the Control
         List controls = message.getControls();

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java Sat Jun  3 03:07:50 2006
@@ -878,7 +878,7 @@
         assertEquals( manageReferralControlOID, manageReferralControl.getControlType() );
 
         SearchRequest sr = message.getSearchRequest();
-        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject() );
+        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
         assertEquals( LdapConstants.SCOPE_WHOLE_SUBTREE, sr.getScope() );
         assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
         assertEquals( 0, sr.getSizeLimit() );
@@ -1119,7 +1119,7 @@
         assertTrue( ( ( SubEntryControl ) subEntryControl.getControlValue() ).isVisible() );
 
         SearchRequest sr = message.getSearchRequest();
-        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject() );
+        assertEquals( "dc=my-domain,dc=com", sr.getBaseObject().toString() );
         assertEquals( LdapConstants.SCOPE_WHOLE_SUBTREE, sr.getScope() );
         assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
         assertEquals( 0, sr.getSizeLimit() );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java Sat Jun  3 03:07:50 2006
@@ -99,7 +99,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -206,7 +206,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -318,7 +318,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 2, message.getMessageId() );
-        assertEquals( "uid=admin,ou=system", searchResultEntry.getObjectName() );
+        assertEquals( "uid=admin,ou=system", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -538,7 +538,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -785,7 +785,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -870,7 +870,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -955,7 +955,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -1049,7 +1049,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 
@@ -1142,7 +1142,7 @@
         SearchResultEntry searchResultEntry = message.getSearchResultEntry();
 
         assertEquals( 1, message.getMessageId() );
-        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName() );
+        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );
 
         Attributes partialAttributesList = searchResultEntry.getPartialAttributeList();
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java Sat Jun  3 03:07:50 2006
@@ -27,6 +27,7 @@
 import org.apache.directory.shared.ldap.codec.search.controls.EntryChangeControl;
 import org.apache.directory.shared.ldap.codec.search.controls.EntryChangeControlContainer;
 import org.apache.directory.shared.ldap.codec.search.controls.EntryChangeControlDecoder;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 import junit.framework.Assert;
@@ -73,7 +74,7 @@
 
         EntryChangeControl entryChange = container.getEntryChangeControl();
         assertEquals( ChangeType.MODDN, entryChange.getChangeType() );
-        assertEquals( "a=b", entryChange.getPreviousDn() );
+        assertEquals( "a=b", entryChange.getPreviousDn().toString() );
         assertEquals( 16, entryChange.getChangeNumber() );
     }
 
@@ -109,7 +110,7 @@
 
         EntryChangeControl entryChange = container.getEntryChangeControl();
         assertEquals( ChangeType.ADD, entryChange.getChangeType() );
-        assertEquals( "", entryChange.getPreviousDn() );
+        assertNull( entryChange.getPreviousDn() );
         assertEquals( 16, entryChange.getChangeNumber() );
     }
 
@@ -182,7 +183,7 @@
 
         EntryChangeControl entryChange = container.getEntryChangeControl();
         assertEquals( ChangeType.ADD, entryChange.getChangeType() );
-        assertEquals( "", entryChange.getPreviousDn() );
+        assertNull( entryChange.getPreviousDn() );
         assertEquals( EntryChangeControl.UNDEFINED_CHANGE_NUMBER, entryChange.getChangeNumber() );
     }
 
@@ -244,7 +245,7 @@
         EntryChangeControl entry = new EntryChangeControl();
         entry.setChangeType( ChangeType.MODDN );
         entry.setChangeNumber( 16 );
-        entry.setPreviousDn( "a=b" );
+        entry.setPreviousDn( new LdapDN( "a=b" ) );
         bb = entry.encode( null );
         String decoded = StringTools.dumpBytes( bb.array() );
         assertEquals( expected, decoded );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java Sat Jun  3 03:07:50 2006
@@ -17,6 +17,8 @@
 package org.apache.directory.shared.ldap.message;
 
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.AbstractResultResponse;
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.LdapResult;
@@ -24,6 +26,7 @@
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import junit.framework.TestCase;
 
@@ -53,7 +56,7 @@
     /**
      * Tests to see the same exact copy returns true.
      */
-    public void testEqualsExactCopy()
+    public void testEqualsExactCopy() throws InvalidNameException
     {
         AbstractResultResponse msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST )
         {
@@ -69,8 +72,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=example,dc=com" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
@@ -91,7 +94,7 @@
     /**
      * Tests to see the same exact copy returns true.
      */
-    public void testNotEqualsDiffResult()
+    public void testNotEqualsDiffResult() throws InvalidNameException
     {
         AbstractResultResponse msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST )
         {
@@ -107,8 +110,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=apache,dc=org" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=apache,dc=org" ) );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,6 +22,7 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.shared.ldap.message.AbandonListener;
@@ -33,6 +34,7 @@
 import org.apache.directory.shared.ldap.message.MessageException;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.ResultResponse;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -88,14 +90,14 @@
     /**
      * Tests for equality using exact copies.
      */
-    public void testEqualsExactCopy()
+    public void testEqualsExactCopy() throws InvalidNameException
     {
         AddRequestImpl req0 = new AddRequestImpl( 5 );
-        req0.setEntry( "cn=admin,dc=example,dc=com" );
+        req0.setEntry( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setAttributes( getAttributes() );
 
         AddRequestImpl req1 = new AddRequestImpl( 5 );
-        req1.setEntry( "cn=admin,dc=example,dc=com" );
+        req1.setEntry( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setAttributes( getAttributes() );
 
         assertTrue( req0.equals( req1 ) );
@@ -105,14 +107,14 @@
     /**
      * Test for inequality when only the IDs are different.
      */
-    public void testNotEqualDiffId()
+    public void testNotEqualDiffId() throws InvalidNameException
     {
         AddRequestImpl req0 = new AddRequestImpl( 7 );
-        req0.setEntry( "cn=admin,dc=example,dc=com" );
+        req0.setEntry( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setAttributes( getAttributes() );
 
         AddRequestImpl req1 = new AddRequestImpl( 5 );
-        req1.setEntry( "cn=admin,dc=example,dc=com" );
+        req1.setEntry( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setAttributes( getAttributes() );
 
         assertFalse( req0.equals( req1 ) );
@@ -122,14 +124,14 @@
     /**
      * Test for inequality when only the DN names are different.
      */
-    public void testNotEqualDiffName()
+    public void testNotEqualDiffName() throws InvalidNameException
     {
         AddRequestImpl req0 = new AddRequestImpl( 5 );
-        req0.setEntry( "cn=admin,dc=example,dc=com" );
+        req0.setEntry( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setAttributes( getAttributes() );
 
         AddRequestImpl req1 = new AddRequestImpl( 5 );
-        req1.setEntry( "cn=admin,dc=apache,dc=org" );
+        req1.setEntry( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
         req1.setAttributes( getAttributes() );
 
         assertFalse( req0.equals( req1 ) );
@@ -139,14 +141,14 @@
     /**
      * Test for inequality when only the DN names are different.
      */
-    public void testNotEqualDiffAttributes()
+    public void testNotEqualDiffAttributes() throws InvalidNameException
     {
         AddRequestImpl req0 = new AddRequestImpl( 5 );
-        req0.setEntry( "cn=admin,dc=apache,dc=org" );
+        req0.setEntry( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
         req0.setAttributes( getAttributes() );
 
         AddRequestImpl req1 = new AddRequestImpl( 5 );
-        req1.setEntry( "cn=admin,dc=apache,dc=org" );
+        req1.setEntry( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
 
         assertFalse( req0.equals( req1 ) );
         assertFalse( req1.equals( req0 ) );
@@ -181,13 +183,13 @@
             }
 
 
-            public String getEntry()
+            public LdapDN getEntry()
             {
                 return null;
             }
 
 
-            public void setEntry( String entry )
+            public void setEntry( LdapDN entry )
             {
             }
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,12 +22,15 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.BindRequest;
 import org.apache.directory.shared.ldap.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.MessageException;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.ResultResponse;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -51,17 +54,17 @@
     /**
      * Tests for equality using exact copies.
      */
-    public void testEqualsExactCopy()
+    public void testEqualsExactCopy() throws InvalidNameException
     {
         BindRequestImpl req0 = new BindRequestImpl( 5 );
         req0.setCredentials( "password".getBytes() );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setSimple( true );
         req0.setVersion3( true );
 
         BindRequestImpl req1 = new BindRequestImpl( 5 );
         req1.setCredentials( "password".getBytes() );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setSimple( true );
         req1.setVersion3( true );
 
@@ -72,17 +75,17 @@
     /**
      * Test for inequality when only the IDs are different.
      */
-    public void testNotEqualDiffId()
+    public void testNotEqualDiffId() throws InvalidNameException
     {
         BindRequestImpl req0 = new BindRequestImpl( 7 );
         req0.setCredentials( "password".getBytes() );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setSimple( true );
         req0.setVersion3( true );
 
         BindRequestImpl req1 = new BindRequestImpl( 5 );
         req1.setCredentials( "password".getBytes() );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setSimple( true );
         req1.setVersion3( true );
 
@@ -93,17 +96,17 @@
     /**
      * Test for inequality when only the credentials are different.
      */
-    public void testNotEqualDiffCreds()
+    public void testNotEqualDiffCreds() throws InvalidNameException
     {
         BindRequestImpl req0 = new BindRequestImpl( 5 );
         req0.setCredentials( "abcdefg".getBytes() );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setSimple( true );
         req0.setVersion3( true );
 
         BindRequestImpl req1 = new BindRequestImpl( 5 );
         req1.setCredentials( "password".getBytes() );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setSimple( true );
         req1.setVersion3( true );
 
@@ -114,17 +117,17 @@
     /**
      * Test for inequality when only the DN names are different.
      */
-    public void testNotEqualDiffName()
+    public void testNotEqualDiffName() throws InvalidNameException
     {
         BindRequestImpl req0 = new BindRequestImpl( 5 );
         req0.setCredentials( "password".getBytes() );
-        req0.setName( "uid=akarasulu,dc=example,dc=com" );
+        req0.setName( new LdapDN( "uid=akarasulu,dc=example,dc=com" ) );
         req0.setSimple( true );
         req0.setVersion3( true );
 
         BindRequestImpl req1 = new BindRequestImpl( 5 );
         req1.setCredentials( "password".getBytes() );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setSimple( true );
         req1.setVersion3( true );
 
@@ -135,17 +138,17 @@
     /**
      * Test for inequality when only the auth mechanisms are different.
      */
-    public void testNotEqualDiffSimple()
+    public void testNotEqualDiffSimple() throws InvalidNameException
     {
         BindRequestImpl req0 = new BindRequestImpl( 5 );
         req0.setCredentials( "password".getBytes() );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setSimple( false );
         req0.setVersion3( true );
 
         BindRequestImpl req1 = new BindRequestImpl( 5 );
         req1.setCredentials( "password".getBytes() );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setSimple( true );
         req1.setVersion3( true );
 
@@ -156,17 +159,17 @@
     /**
      * Test for inequality when only the bind LDAP versions are different.
      */
-    public void testNotEqualDiffVersion()
+    public void testNotEqualDiffVersion() throws InvalidNameException
     {
         BindRequestImpl req0 = new BindRequestImpl( 5 );
         req0.setCredentials( "password".getBytes() );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setSimple( true );
         req0.setVersion3( false );
 
         BindRequestImpl req1 = new BindRequestImpl( 5 );
         req1.setCredentials( "password".getBytes() );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setSimple( true );
         req1.setVersion3( true );
 
@@ -209,13 +212,13 @@
             }
 
 
-            public String getName()
+            public LdapDN getName()
             {
-                return "";
+                return null;
             }
 
 
-            public void setName( String a_name )
+            public void setName( LdapDN name )
             {
             }
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java Sat Jun  3 03:07:50 2006
@@ -17,11 +17,14 @@
 package org.apache.directory.shared.ldap.message;
 
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.message.LdapResultImpl;
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import junit.framework.TestCase;
 
@@ -88,7 +91,7 @@
     /**
      * Tests for equality of two fully loaded identical BindResponse PDUs.
      */
-    public void testEqualsWithTheWorks()
+    public void testEqualsWithTheWorks() throws InvalidNameException
     {
         LdapResultImpl r0 = new LdapResultImpl();
         LdapResultImpl r1 = new LdapResultImpl();
@@ -96,8 +99,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=example,dc=com" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,6 +22,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.AbandonListener;
 import org.apache.directory.shared.ldap.message.CompareRequest;
 import org.apache.directory.shared.ldap.message.CompareRequestImpl;
@@ -29,6 +31,7 @@
 import org.apache.directory.shared.ldap.message.MessageException;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.ResultResponse;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -52,15 +55,15 @@
     /**
      * Tests for equality using exact copies.
      */
-    public void testEqualsExactCopy()
+    public void testEqualsExactCopy() throws InvalidNameException
     {
         CompareRequestImpl req0 = new CompareRequestImpl( 5 );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req0.setAttributeId( "objectClass" );
         req0.setAssertionValue( "top" );
 
         CompareRequestImpl req1 = new CompareRequestImpl( 5 );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
         req1.setAttributeId( "objectClass" );
         req1.setAssertionValue( "top" );
 
@@ -72,13 +75,13 @@
     /**
      * Test for inequality when only the IDs are different.
      */
-    public void testNotEqualDiffId()
+    public void testNotEqualDiffId() throws InvalidNameException
     {
         CompareRequestImpl req0 = new CompareRequestImpl( 7 );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         CompareRequestImpl req1 = new CompareRequestImpl( 5 );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         assertFalse( req0.equals( req1 ) );
         assertFalse( req1.equals( req0 ) );
@@ -88,15 +91,15 @@
     /**
      * Test for inequality when only the attributeIds are different.
      */
-    public void testNotEqualDiffAttributeIds()
+    public void testNotEqualDiffAttributeIds() throws InvalidNameException
     {
         CompareRequestImpl req0 = new CompareRequestImpl( 5 );
-        req0.setName( "cn=admin,dc=apache,dc=org" );
+        req0.setName( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
         req0.setAttributeId( "dc" );
         req0.setAssertionValue( "apache.org" );
 
         CompareRequestImpl req1 = new CompareRequestImpl( 5 );
-        req1.setName( "cn=admin,dc=apache,dc=org" );
+        req1.setName( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
         req1.setAttributeId( "nisDomain" );
         req1.setAssertionValue( "apache.org" );
 
@@ -108,15 +111,15 @@
     /**
      * Test for inequality when only the Assertion values are different.
      */
-    public void testNotEqualDiffValue()
+    public void testNotEqualDiffValue() throws InvalidNameException
     {
         CompareRequestImpl req0 = new CompareRequestImpl( 5 );
-        req0.setName( "cn=admin,dc=apache,dc=org" );
+        req0.setName( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
         req0.setAttributeId( "dc" );
         req0.setAssertionValue( "apache.org" );
 
         CompareRequestImpl req1 = new CompareRequestImpl( 5 );
-        req1.setName( "cn=admin,dc=apache,dc=org" );
+        req1.setName( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
         req1.setAttributeId( "dc" );
         req1.setAssertionValue( "nagoya.apache.org" );
 
@@ -163,13 +166,13 @@
             }
 
 
-            public String getName()
+            public LdapDN getName()
             {
                 return null;
             }
 
 
-            public void setName( String a_name )
+            public void setName( LdapDN name )
             {
             }
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,6 +22,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.AbandonListener;
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.DeleteRequest;
@@ -29,6 +31,7 @@
 import org.apache.directory.shared.ldap.message.MessageException;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.ResultResponse;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -52,13 +55,13 @@
     /**
      * Tests for equality using exact copies.
      */
-    public void testEqualsExactCopy()
+    public void testEqualsExactCopy() throws InvalidNameException
     {
         DeleteRequestImpl req0 = new DeleteRequestImpl( 5 );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         DeleteRequestImpl req1 = new DeleteRequestImpl( 5 );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         assertTrue( req0.equals( req1 ) );
     }
@@ -67,13 +70,13 @@
     /**
      * Test for inequality when only the IDs are different.
      */
-    public void testNotEqualDiffId()
+    public void testNotEqualDiffId() throws InvalidNameException
     {
         DeleteRequestImpl req0 = new DeleteRequestImpl( 7 );
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         DeleteRequestImpl req1 = new DeleteRequestImpl( 5 );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         assertFalse( req0.equals( req1 ) );
     }
@@ -82,13 +85,13 @@
     /**
      * Test for inequality when only the DN names are different.
      */
-    public void testNotEqualDiffName()
+    public void testNotEqualDiffName() throws InvalidNameException
     {
         DeleteRequestImpl req0 = new DeleteRequestImpl( 5 );
-        req0.setName( "uid=akarasulu,dc=example,dc=com" );
+        req0.setName( new LdapDN( "uid=akarasulu,dc=example,dc=com" ) );
 
         DeleteRequestImpl req1 = new DeleteRequestImpl( 5 );
-        req1.setName( "cn=admin,dc=example,dc=com" );
+        req1.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         assertFalse( req0.equals( req1 ) );
     }
@@ -102,13 +105,13 @@
     {
         DeleteRequest req0 = new DeleteRequest()
         {
-            public String getName()
+            public LdapDN getName()
             {
                 return null;
             }
 
 
-            public void setName( String a_name )
+            public void setName( LdapDN name )
             {
             }
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,6 +22,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
@@ -31,6 +33,7 @@
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -53,7 +56,16 @@
         response.setResponse( "Hello World!".getBytes() );
         response.setResponseName( "1.1.1.1" );
         LdapResult result = response.getLdapResult();
-        result.setMatchedDn( "dc=example,dc=com" );
+        
+        try
+        {
+            result.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        }
+        catch ( InvalidNameException ine )
+        {
+            // Do nothing
+        }
+        
         result.setResultCode( ResultCodeEnum.SUCCESS );
         ReferralImpl refs = new ReferralImpl();
         refs.addLdapUrl( "ldap://someserver.com" );
@@ -122,7 +134,16 @@
             public LdapResult getLdapResult()
             {
                 LdapResultImpl result = new LdapResultImpl();
-                result.setMatchedDn( "dc=example,dc=com" );
+                
+                try 
+                {
+                    result.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+                }
+                catch ( InvalidNameException ine ) 
+                {
+                    // do nothing
+                }
+                
                 result.setResultCode( ResultCodeEnum.SUCCESS );
                 ReferralImpl refs = new ReferralImpl();
                 refs.addLdapUrl( "ldap://someserver.com" );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java Sat Jun  3 03:07:50 2006
@@ -17,11 +17,14 @@
 package org.apache.directory.shared.ldap.message;
 
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.LdapResultImpl;
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import junit.framework.TestCase;
 
@@ -90,13 +93,13 @@
             }
 
 
-            public String getMatchedDn()
+            public LdapDN getMatchedDn()
             {
                 return null;
             }
 
 
-            public void setMatchedDn( String a_dn )
+            public void setMatchedDn( LdapDN dn )
             {
             }
 
@@ -137,7 +140,7 @@
     /**
      * Tests two non default carbon copies for equality.
      */
-    public void testEqualsCarbonCopy()
+    public void testEqualsCarbonCopy() throws InvalidNameException
     {
         LdapResultImpl r0 = new LdapResultImpl();
         LdapResultImpl r1 = new LdapResultImpl();
@@ -145,8 +148,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=example,dc=com" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
@@ -167,7 +170,7 @@
     /**
      * Tests for inequality when the error message is different.
      */
-    public void testNotEqualsDiffErrorMessage()
+    public void testNotEqualsDiffErrorMessage() throws InvalidNameException
     {
         LdapResultImpl r0 = new LdapResultImpl();
         LdapResultImpl r1 = new LdapResultImpl();
@@ -175,8 +178,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=example,dc=com" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
@@ -197,7 +200,7 @@
     /**
      * Tests for inequality when the matchedDn properties are not the same.
      */
-    public void testNotEqualsDiffMatchedDn()
+    public void testNotEqualsDiffMatchedDn() throws InvalidNameException
     {
         LdapResultImpl r0 = new LdapResultImpl();
         LdapResultImpl r1 = new LdapResultImpl();
@@ -205,8 +208,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=apache,dc=org" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=apache,dc=org")  );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
@@ -227,7 +230,7 @@
     /**
      * Tests for inequality when the resultCode properties are not the same.
      */
-    public void testNotEqualsDiffResultCode()
+    public void testNotEqualsDiffResultCode() throws InvalidNameException
     {
         LdapResultImpl r0 = new LdapResultImpl();
         LdapResultImpl r1 = new LdapResultImpl();
@@ -235,8 +238,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=example,dc=com" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.SIZELIMITEXCEEDED );
@@ -257,7 +260,7 @@
     /**
      * Tests for inequality when the referrals are not the same.
      */
-    public void testNotEqualsDiffReferrals()
+    public void testNotEqualsDiffReferrals() throws InvalidNameException
     {
         LdapResultImpl r0 = new LdapResultImpl();
         LdapResultImpl r1 = new LdapResultImpl();
@@ -265,8 +268,8 @@
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
 
-        r0.setMatchedDn( "dc=example,dc=com" );
-        r1.setMatchedDn( "dc=example,dc=com" );
+        r0.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        r1.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
 
         r0.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );
         r1.setResultCode( ResultCodeEnum.TIMELIMITEXCEEDED );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,6 +22,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.AbandonListener;
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.MessageException;
@@ -29,6 +31,8 @@
 import org.apache.directory.shared.ldap.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultResponse;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.name.Rdn;
 
 
 /**
@@ -49,9 +53,18 @@
         // Construct the ModifyDn request to test
         ModifyDnRequestImpl request = new ModifyDnRequestImpl( 45 );
         request.setDeleteOldRdn( true );
-        request.setName( "dc=admins,dc=apache,dc=org" );
-        request.setNewRdn( "dc=administrators" );
-        request.setNewSuperior( "dc=groups,dc=apache,dc=org" );
+        
+        try
+        {
+            request.setName( new LdapDN( "dc=admins,dc=apache,dc=org" ) );
+            request.setNewRdn( new Rdn( "dc=administrators" ) );
+            request.setNewSuperior( new LdapDN( "dc=groups,dc=apache,dc=org" ) );
+        }
+        catch ( InvalidNameException ine )
+        {
+            // do nothing
+        }
+        
         return request;
     }
 
@@ -107,13 +120,13 @@
     /**
      * Test for inequality when only the DN names are different.
      */
-    public void testNotEqualDiffName()
+    public void testNotEqualDiffName() throws InvalidNameException
     {
         ModifyDnRequestImpl req0 = getRequest();
-        req0.setName( "cn=admin,dc=example,dc=com" );
+        req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         ModifyDnRequestImpl req1 = getRequest();
-        req1.setName( "cn=admin,dc=apache,dc=org" );
+        req1.setName( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
 
         assertFalse( req0.equals( req1 ) );
     }
@@ -122,13 +135,13 @@
     /**
      * Test for inequality when only the newSuperior DNs are different.
      */
-    public void testNotEqualDiffNewSuperior()
+    public void testNotEqualDiffNewSuperior() throws InvalidNameException
     {
         ModifyDnRequestImpl req0 = getRequest();
-        req0.setNewSuperior( "cn=admin,dc=example,dc=com" );
+        req0.setNewSuperior( new LdapDN( "cn=admin,dc=example,dc=com" ) );
 
         ModifyDnRequestImpl req1 = getRequest();
-        req1.setNewSuperior( "cn=admin,dc=apache,dc=org" );
+        req1.setNewSuperior( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
 
         assertFalse( req0.equals( req1 ) );
     }
@@ -152,13 +165,13 @@
     /**
      * Test for inequality when only the new Rdn properties are different.
      */
-    public void testNotEqualDiffNewRdn()
+    public void testNotEqualDiffNewRdn() throws InvalidNameException
     {
         ModifyDnRequestImpl req0 = getRequest();
-        req0.setNewRdn( "cn=admin0" );
+        req0.setNewRdn( new Rdn( "cn=admin0" ) );
 
         ModifyDnRequestImpl req1 = getRequest();
-        req1.setNewRdn( "cn=admin1" );
+        req1.setNewRdn( new Rdn( "cn=admin1" ) );
 
         assertFalse( req0.equals( req1 ) );
         assertFalse( req1.equals( req0 ) );
@@ -172,24 +185,40 @@
     {
         ModifyDnRequest req0 = new ModifyDnRequest()
         {
-            public String getName()
+            public LdapDN getName()
             {
-                return "dc=admins,dc=apache,dc=org";
+                try
+                {
+                    return new LdapDN( "dc=admins,dc=apache,dc=org" );
+                }
+                catch ( InvalidNameException ine )
+                {
+                    // do nothing
+                    return null;
+                }
             }
 
 
-            public void setName( String a_name )
+            public void setName( LdapDN name )
             {
             }
 
 
-            public String getNewRdn()
+            public Rdn getNewRdn()
             {
-                return "dc=administrators";
+                try
+                {
+                    return new Rdn( "dc=administrators" );
+                }
+                catch ( InvalidNameException ine )
+                {
+                    // do nothing
+                    return null;
+                }
             }
 
 
-            public void setNewRdn( String a_newRdn )
+            public void setNewRdn( Rdn newRdn )
             {
             }
 
@@ -200,18 +229,26 @@
             }
 
 
-            public void setDeleteOldRdn( boolean a_deleteOldRdn )
+            public void setDeleteOldRdn( boolean deleteOldRdn )
             {
             }
 
 
-            public String getNewSuperior()
+            public LdapDN getNewSuperior()
             {
-                return "dc=groups,dc=apache,dc=org";
+                try
+                {
+                    return new LdapDN( "dc=groups,dc=apache,dc=org" );
+                }
+                catch ( InvalidNameException ine )
+                {
+                    // do nothing
+                    return null;
+                }
             }
 
 
-            public void setNewSuperior( String a_newSuperior )
+            public void setNewSuperior( LdapDN newSuperior )
             {
             }
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java Sat Jun  3 03:07:50 2006
@@ -19,6 +19,7 @@
 
 import junit.framework.TestCase;
 
+import javax.naming.InvalidNameException;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 
@@ -30,6 +31,7 @@
 import org.apache.directory.shared.ldap.message.ModifyRequest;
 import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.message.ResultResponse;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -54,7 +56,15 @@
     {
         // Construct the Modify request to test
         ModifyRequestImpl req = new ModifyRequestImpl( 45 );
-        req.setName( "cn=admin,dc=apache,dc=org" );
+        
+        try 
+        {
+            req.setName( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
+        }
+        catch ( InvalidNameException ne )
+        {
+            // do nothing
+        }
 
         LockableAttributeImpl attr = new LockableAttributeImpl( "attr0" );
         attr.add( "val0" );
@@ -81,7 +91,7 @@
     /**
      * Tests the same object referrence for equality.
      */
-    public void testEqualsSameObj()
+    public void testEqualsSameObj() throws InvalidNameException
     {
         ModifyRequestImpl req = getRequest();
         assertTrue( req.equals( req ) );
@@ -91,7 +101,7 @@
     /**
      * Tests for equality using exact copies.
      */
-    public void testEqualsExactCopy()
+    public void testEqualsExactCopy() throws InvalidNameException
     {
         ModifyRequestImpl req0 = getRequest();
         ModifyRequestImpl req1 = getRequest();
@@ -115,19 +125,26 @@
      */
     public void testNotEqualDiffName()
     {
-        ModifyRequestImpl req0 = getRequest();
-        req0.setName( "cn=admin,dc=example,dc=com" );
-        ModifyRequestImpl req1 = getRequest();
-        req1.setName( "cn=admin,dc=apache,dc=org" );
-
-        assertFalse( req0.equals( req1 ) );
+        try
+        {
+            ModifyRequestImpl req0 = getRequest();
+            req0.setName( new LdapDN( "cn=admin,dc=example,dc=com" ) );
+            ModifyRequestImpl req1 = getRequest();
+            req1.setName( new LdapDN( "cn=admin,dc=apache,dc=org" ) );
+
+            assertFalse( req0.equals( req1 ) );
+        }
+        catch ( InvalidNameException ine )
+        {
+            // do nothing
+        }
     }
 
 
     /**
      * Test for inequality when only the mods ops are different.
      */
-    public void testNotEqualDiffModOps()
+    public void testNotEqualDiffModOps() throws InvalidNameException
     {
         ModifyRequestImpl req0 = getRequest();
         LockableAttributeImpl attr = new LockableAttributeImpl( "attr3" );
@@ -153,7 +170,7 @@
     /**
      * Test for inequality when only the number of mods are different.
      */
-    public void testNotEqualDiffModCount()
+    public void testNotEqualDiffModCount() throws InvalidNameException
     {
         ModifyRequestImpl req0 = getRequest();
         LockableAttributeImpl attr = new LockableAttributeImpl( "attr3" );
@@ -173,7 +190,7 @@
     /**
      * Test for inequality when only the mods attribute Id's are different.
      */
-    public void testNotEqualDiffModIds()
+    public void testNotEqualDiffModIds() throws InvalidNameException
     {
         ModifyRequestImpl req0 = getRequest();
         LockableAttributeImpl attr = new LockableAttributeImpl( "attr3" );
@@ -199,7 +216,7 @@
     /**
      * Test for inequality when only the mods attribute values are different.
      */
-    public void testNotEqualDiffModValues()
+    public void testNotEqualDiffModValues() throws InvalidNameException
     {
         ModifyRequestImpl req0 = getRequest();
         LockableAttributeImpl attr = new LockableAttributeImpl( "attr3" );
@@ -265,13 +282,21 @@
             }
 
 
-            public String getName()
+            public LdapDN getName()
             {
-                return "cn=admin,dc=apache,dc=org";
+                try
+                {
+                    return new LdapDN( "cn=admin,dc=apache,dc=org" );
+                }
+                catch ( Exception e )
+                {
+                    //do nothing
+                    return null;
+                }
             }
 
 
-            public void setName( String a_name )
+            public void setName( LdapDN name )
             {
             }
 

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,6 +22,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
+
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.LdapResultImpl;
@@ -31,6 +33,7 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.SearchResponseDone;
 import org.apache.directory.shared.ldap.message.SearchResponseDoneImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -51,7 +54,16 @@
         // Construct the Search response to test with results and referrals
         SearchResponseDoneImpl response = new SearchResponseDoneImpl( 45 );
         LdapResult result = response.getLdapResult();
-        result.setMatchedDn( "dc=example,dc=com" );
+        
+        try
+        {
+            result.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+        }
+        catch ( InvalidNameException ine )
+        {
+            // do nothing
+        }
+        
         result.setResultCode( ResultCodeEnum.SUCCESS );
         ReferralImpl refs = new ReferralImpl();
         refs.addLdapUrl( "ldap://someserver.com" );
@@ -95,7 +107,15 @@
             public LdapResult getLdapResult()
             {
                 LdapResultImpl result = new LdapResultImpl();
-                result.setMatchedDn( "dc=example,dc=com" );
+                
+                try
+                {
+                    result.setMatchedDn( new LdapDN( "dc=example,dc=com" ) );
+                }
+                catch ( Exception e ) 
+                {
+                    // Do nothing
+                }
                 result.setResultCode( ResultCodeEnum.SUCCESS );
                 ReferralImpl refs = new ReferralImpl();
                 refs.addLdapUrl( "ldap://someserver.com" );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java Sat Jun  3 03:07:50 2006
@@ -22,6 +22,7 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.InvalidNameException;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.shared.ldap.message.Control;
@@ -31,6 +32,7 @@
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.SearchResponseEntry;
 import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -86,15 +88,15 @@
     /**
      * Tests for equality when an exact copy is compared.
      */
-    public void testEqualsExactCopy()
+    public void testEqualsExactCopy() throws InvalidNameException
     {
         SearchResponseEntryImpl resp0 = new SearchResponseEntryImpl( 5 );
         resp0.setAttributes( getAttributes() );
-        resp0.setObjectName( "dc=example,dc=com" );
+        resp0.setObjectName( new LdapDN( "dc=example,dc=com" ) );
 
         SearchResponseEntryImpl resp1 = new SearchResponseEntryImpl( 5 );
         resp1.setAttributes( getAttributes() );
-        resp1.setObjectName( "dc=example,dc=com" );
+        resp1.setObjectName( new LdapDN( "dc=example,dc=com" ) );
 
         assertTrue( "exact copies should be equal", resp0.equals( resp1 ) );
         assertTrue( "exact copies should be equal", resp1.equals( resp0 ) );
@@ -108,13 +110,21 @@
     {
         SearchResponseEntry resp0 = new SearchResponseEntry()
         {
-            public String getObjectName()
+            public LdapDN getObjectName()
             {
-                return "dc=example,dc=com";
+                try
+                {
+                    return new LdapDN( "dc=example,dc=com" );
+                }
+                catch ( InvalidNameException ine )
+                {
+                    // Do nothing
+                    return null;
+                }
             }
 
 
-            public void setObjectName( String dn )
+            public void setObjectName( LdapDN dn )
             {
             }
 
@@ -172,7 +182,15 @@
 
         SearchResponseEntryImpl resp1 = new SearchResponseEntryImpl( 5 );
         resp1.setAttributes( getAttributes() );
-        resp1.setObjectName( "dc=example,dc=com" );
+        
+        try
+        {
+            resp1.setObjectName( new LdapDN( "dc=example,dc=com" ) );
+        }
+        catch ( Exception e )
+        {
+            // Do nothing
+        }
 
         assertFalse( "using Object.equal() should NOT be equal", resp0.equals( resp1 ) );
         assertTrue( "same but different implementations should be equal", resp1.equals( resp0 ) );
@@ -182,15 +200,15 @@
     /**
      * Tests for inequality when the objectName dn is not the same.
      */
-    public void testNotEqualDiffObjectName()
+    public void testNotEqualDiffObjectName() throws InvalidNameException
     {
         SearchResponseEntryImpl resp0 = new SearchResponseEntryImpl( 5 );
         resp0.setAttributes( getAttributes() );
-        resp0.setObjectName( "dc=apache,dc=org" );
+        resp0.setObjectName( new LdapDN( "dc=apache,dc=org" ) );
 
         SearchResponseEntryImpl resp1 = new SearchResponseEntryImpl( 5 );
         resp1.setAttributes( getAttributes() );
-        resp1.setObjectName( "dc=example,dc=com" );
+        resp1.setObjectName( new LdapDN( "dc=example,dc=com" ) );
 
         assertFalse( "different object names should not be equal", resp1.equals( resp0 ) );
         assertFalse( "different object names should not be equal", resp0.equals( resp1 ) );
@@ -200,16 +218,16 @@
     /**
      * Tests for inequality when the attributes are not the same.
      */
-    public void testNotEqualDiffAttributes()
+    public void testNotEqualDiffAttributes() throws InvalidNameException
     {
         SearchResponseEntryImpl resp0 = new SearchResponseEntryImpl( 5 );
         resp0.setAttributes( getAttributes() );
         resp0.getAttributes().put( "abc", "123" );
-        resp0.setObjectName( "dc=apache,dc=org" );
+        resp0.setObjectName( new LdapDN( "dc=apache,dc=org" ) );
 
         SearchResponseEntryImpl resp1 = new SearchResponseEntryImpl( 5 );
         resp1.setAttributes( getAttributes() );
-        resp1.setObjectName( "dc=apache,dc=org" );
+        resp1.setObjectName( new LdapDN( "dc=apache,dc=org" ) );
 
         assertFalse( "different attributes should not be equal", resp1.equals( resp0 ) );
         assertFalse( "different attributes should not be equal", resp0.equals( resp1 ) );

Modified: directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java?rev=411416&r1=411415&r2=411416&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java (original)
+++ directory/branches/shared/optimization/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java Sat Jun  3 03:07:50 2006
@@ -17,8 +17,9 @@
 package org.apache.directory.shared.ldap.name;
 
 
+import java.util.ArrayList;
+
 import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
 
 import junit.framework.TestCase;
 
@@ -32,30 +33,14 @@
  */
 public class DnParserDIRSERVER_584_Test extends TestCase
 {
-    static DnParser parser; 
-    
-    
-    public static DnParser getParser() throws NamingException
-    {
-        if ( parser == null )
-        {
-            parser = new DnParser();
-        }
-        
-        return parser;
-    }
-    
-    
     /**
      * Need this testa() to run first to mess up the state of the static parser.
      */
     public void testa() throws Exception
     {
-        DnParser parser = getParser();
-        
         try
         {
-            parser.parse( "ou=test=testing" );
+            LdapDnParser.parseInternal( "ou=test=testing", new ArrayList() );
             fail( "should never get here" );
         }
         catch ( InvalidNameException e )
@@ -70,7 +55,6 @@
      */
     public void testb() throws Exception
     {
-        DnParser parser = getParser();
-        parser.parse( "ou=system" );
+        LdapDnParser.parseInternal( "ou=system", new ArrayList() );
     }
 }



Mime
View raw message