directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r414013 [4/5] - in /directory/branches/shared/0.9.5: ./ asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/ ldap/ ldap/src/main/antlr/ ldap/src/main/java/org/apache...
Date Wed, 14 Jun 2006 01:00:41 GMT
Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestTest.java Tue Jun 13 18:00:35 2006
@@ -20,6 +20,8 @@
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -68,6 +70,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
 
@@ -124,6 +131,11 @@
             de.printStackTrace();
             fail( de.getMessage() );
         }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
 
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
 
@@ -187,6 +199,11 @@
         {
             assertTrue( true );
             return;
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
         }
 
         fail( "We should not reach this point" );

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java Tue Jun 13 18:00:35 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/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java Tue Jun 13 18:00:35 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() );
     }
 }

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java Tue Jun 13 18:00:35 2006
@@ -70,7 +70,7 @@
      */
     public void testLdapDNNull() throws DecoderException
     {
-        Assert.assertEquals( "", new LdapDN().getName() );
+        Assert.assertEquals( "", new LdapDN().getUpName() );
     }
 
 
@@ -79,7 +79,7 @@
      */
     public void testLdapDNEmpty() throws InvalidNameException
     {
-        Assert.assertEquals( "", new LdapDN( "" ).getName() );
+        Assert.assertEquals( "", new LdapDN( "" ).getUpName() );
     }
 
 
@@ -89,7 +89,7 @@
     public void testLdapDNSimple() throws InvalidNameException
     {
         LdapDN dn = new LdapDN( "a = b" );
-        Assert.assertEquals( "a = b", dn.getName() );
+        Assert.assertEquals( "a = b", dn.getUpName() );
         Assert.assertEquals( "a=b", dn.toString() );
     }
 
@@ -101,7 +101,7 @@
     {
         LdapDN dn = new LdapDN( "a = b, c = d" );
         Assert.assertEquals( "a=b,c=d", dn.toString() );
-        Assert.assertEquals( "a = b, c = d", dn.getName() );
+        Assert.assertEquals( "a = b, c = d", dn.getUpName() );
     }
 
 
@@ -112,7 +112,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, a =b, a= b, a = b, a  =  b" );
         Assert.assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.toString() );
-        Assert.assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
+        Assert.assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getUpName() );
     }
 
 
@@ -124,7 +124,7 @@
     {
         LdapDN dn = new LdapDN( "a=b;c=d,e=f" );
         Assert.assertEquals( "a=b,c=d,e=f", dn.toString() );
-        Assert.assertEquals( "a=b;c=d,e=f", dn.getName() );
+        Assert.assertEquals( "a=b;c=d,e=f", dn.getUpName() );
     }
 
 
@@ -135,7 +135,7 @@
     {
         LdapDN dn = new LdapDN( "a = b + c = d" );
         Assert.assertEquals( "a=b+c=d", dn.toString() );
-        Assert.assertEquals( "a = b + c = d", dn.getName() );
+        Assert.assertEquals( "a = b + c = d", dn.getUpName() );
     }
 
 
@@ -147,7 +147,7 @@
     {
         LdapDN dn = new LdapDN( "a=b+c=d, e=f + g=h + i=j" );
         Assert.assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.toString() );
-        Assert.assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() );
+        Assert.assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getUpName() );
     }
 
 
@@ -158,7 +158,7 @@
     {
         LdapDN dn = new LdapDN( "OID.12.34.56 = azerty" );
         Assert.assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        Assert.assertEquals( "OID.12.34.56 = azerty", dn.getName() );
+        Assert.assertEquals( "OID.12.34.56 = azerty", dn.getUpName() );
     }
 
 
@@ -169,7 +169,7 @@
     {
         LdapDN dn = new LdapDN( "oid.12.34.56 = azerty" );
         Assert.assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        Assert.assertEquals( "oid.12.34.56 = azerty", dn.getName() );
+        Assert.assertEquals( "oid.12.34.56 = azerty", dn.getUpName() );
     }
 
 
@@ -181,7 +181,7 @@
     {
         LdapDN dn = new LdapDN( "12.34.56 = azerty" );
         Assert.assertEquals( "12.34.56=azerty", dn.toString() );
-        Assert.assertEquals( "12.34.56 = azerty", dn.getName() );
+        Assert.assertEquals( "12.34.56 = azerty", dn.getUpName() );
     }
 
 
@@ -193,7 +193,7 @@
     {
         LdapDN dn = new LdapDN( "12.34.56 = azerty; 7.8 = test" );
         Assert.assertEquals( "12.34.56=azerty,7.8=test", dn.toString() );
-        Assert.assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() );
+        Assert.assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getUpName() );
     }
 
 
@@ -204,7 +204,7 @@
     {
         LdapDN dn = new LdapDN( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00" );
         Assert.assertEquals( "a=\\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.toString() );
-        Assert.assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.getName() );
+        Assert.assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.getUpName() );
     }
 
 
@@ -215,18 +215,59 @@
     {
         LdapDN dn = new LdapDN( "a = #0010A0AAFF" );
         Assert.assertEquals( "a=#0010A0AAFF", dn.toString() );
-        Assert.assertEquals( "a = #0010A0AAFF", dn.getName() );
+        Assert.assertEquals( "a = #0010A0AAFF", dn.getUpName() );
     }
 
+    /**
+     * test a simple DN with a wrong hexString attribute value : a = #0010Z0AAFF
+     */
+    public void testLdapDNWrongHexStringAttributeValue() throws InvalidNameException
+    {
+        try
+        {
+            new LdapDN( "a = #0010Z0AAFF" );
+            fail();
+        }
+        catch ( InvalidNameException ine )
+        {
+            Assert.assertTrue( true );
+        }
+    }
+
+    /**
+     * test a simple DN with a wrong hexString attribute value : a = #AABBCCDD3
+     */
+    public void testLdapDNWrongHexStringAttributeValue2() throws InvalidNameException
+    {
+        try
+        {
+            new LdapDN( "a = #AABBCCDD3" );
+            fail();
+        }
+        catch ( InvalidNameException ine )
+        {
+            Assert.assertTrue( true );
+        }
+    }
+
+    /**
+     * test a simple DN with a quote in attribute value : a = quoted \"value\"
+     */
+    public void testLdapDNQuoteInAttributeValue() throws InvalidNameException
+    {
+        LdapDN dn = new LdapDN( "a = quoted \\\"value\\\"" );
+        Assert.assertEquals( "a=quoted \\\"value\\\"", dn.toString() );
+        Assert.assertEquals( "a = quoted \\\"value\\\"", dn.getUpName() );
+    }
 
     /**
-     * test a simple DN with quoted attribute value : a = "quoted \"value"
+     * test a simple DN with quoted attribute value : a = \" quoted value \"
      */
     public void testLdapDNQuotedAttributeValue() throws InvalidNameException
     {
-        LdapDN dn = new LdapDN( "a = quoted \\\"value" );
-        Assert.assertEquals( "a=quoted \\\"value", dn.toString() );
-        Assert.assertEquals( "a = quoted \\\"value", dn.getName() );
+        LdapDN dn = new LdapDN( "a = \\\" quoted value \\\"" );
+        Assert.assertEquals( "a=\\\" quoted value \\\"", dn.toString() );
+        Assert.assertEquals( "a = \\\" quoted value \\\"", dn.getUpName() );
     }
 
 
@@ -240,7 +281,7 @@
         LdapDN dn = new LdapDN( "a=b, c=d, e=f" );
         Assert.assertEquals( "e=f", dn.remove( 0 ).toString() );
         Assert.assertEquals( "a=b,c=d", dn.toString() );
-        Assert.assertEquals( "a=b, c=d", dn.getName() );
+        Assert.assertEquals( "a=b, c=d", dn.getUpName() );
     }
 
 
@@ -251,7 +292,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d, e=f" );
         Assert.assertEquals( "c=d", dn.remove( 1 ).toString() );
-        Assert.assertEquals( "a=b, e=f", dn.getName() );
+        Assert.assertEquals( "a=b, e=f", dn.getUpName() );
     }
 
 
@@ -262,7 +303,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d, e=f" );
         Assert.assertEquals( "a=b", dn.remove( 2 ).toString() );
-        Assert.assertEquals( " c=d, e=f", dn.getName() );
+        Assert.assertEquals( " c=d, e=f", dn.getUpName() );
     }
 
 
@@ -273,7 +314,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d; e=f" );
         Assert.assertEquals( "c=d", dn.remove( 1 ).toString() );
-        Assert.assertEquals( "a=b, e=f", dn.getName() );
+        Assert.assertEquals( "a=b, e=f", dn.getUpName() );
     }
 
 
@@ -370,7 +411,7 @@
 
         dn.add( "e = f" );
         Assert.assertEquals( "e=f", dn.toString() );
-        Assert.assertEquals( "e = f", dn.getName() );
+        Assert.assertEquals( "e = f", dn.getUpName() );
         Assert.assertEquals( 1, dn.size() );
     }
 
@@ -384,7 +425,7 @@
 
         dn.add( "e = f" );
         Assert.assertEquals( "e=f,a=b,c=d", dn.toString() );
-        Assert.assertEquals( "e = f,a=b, c=d", dn.getName() );
+        Assert.assertEquals( "e = f,a=b, c=d", dn.getUpName() );
         Assert.assertEquals( 3, dn.size() );
     }
 
@@ -414,7 +455,7 @@
         LdapDN dn = new LdapDN( "a=b, c=d" );
 
         dn.add( dn.size(), "e = f" );
-        Assert.assertEquals( "e = f,a=b, c=d", dn.getName() );
+        Assert.assertEquals( "e = f,a=b, c=d", dn.getUpName() );
         Assert.assertEquals( 3, dn.size() );
     }
 
@@ -427,7 +468,7 @@
         LdapDN dn = new LdapDN( "a=b, c=d" );
 
         dn.add( 0, "e = f" );
-        Assert.assertEquals( "a=b, c=d,e = f", dn.getName() );
+        Assert.assertEquals( "a=b, c=d,e = f", dn.getUpName() );
         Assert.assertEquals( 3, dn.size() );
     }
 
@@ -440,7 +481,7 @@
         LdapDN dn = new LdapDN( "a=b, c=d" );
 
         dn.add( 1, "e = f" );
-        Assert.assertEquals( "a=b,e = f, c=d", dn.getName() );
+        Assert.assertEquals( "a=b,e = f, c=d", dn.getUpName() );
         Assert.assertEquals( 3, dn.size() );
     }
 
@@ -456,7 +497,7 @@
         LdapDN dn = new LdapDN( "a = b" );
         LdapDN dn2 = new LdapDN( "c = d" );
         dn.addAll( dn2 );
-        Assert.assertEquals( "c = d,a = b", dn.getName() );
+        Assert.assertEquals( "c = d,a = b", dn.getUpName() );
     }
 
 
@@ -471,7 +512,7 @@
         LdapDN dn2 = new LdapDN();
         dn.addAll( dn2 );
         Assert.assertEquals( "a=b", dn.toString() );
-        Assert.assertEquals( "a = b", dn.getName() );
+        Assert.assertEquals( "a = b", dn.getUpName() );
     }
 
 
@@ -485,7 +526,7 @@
         LdapDN dn = new LdapDN();
         LdapDN dn2 = new LdapDN( "a = b" );
         dn.addAll( dn2 );
-        Assert.assertEquals( "a = b", dn.getName() );
+        Assert.assertEquals( "a = b", dn.getUpName() );
     }
 
 
@@ -499,7 +540,7 @@
         LdapDN dn = new LdapDN( "a = b" );
         LdapDN dn2 = new LdapDN( "c = d" );
         dn.addAll( 0, dn2 );
-        Assert.assertEquals( "a = b,c = d", dn.getName() );
+        Assert.assertEquals( "a = b,c = d", dn.getUpName() );
     }
 
 
@@ -513,7 +554,7 @@
         LdapDN dn = new LdapDN( "a = b" );
         LdapDN dn2 = new LdapDN( "c = d" );
         dn.addAll( 1, dn2 );
-        Assert.assertEquals( "c = d,a = b", dn.getName() );
+        Assert.assertEquals( "c = d,a = b", dn.getUpName() );
     }
 
 
@@ -527,7 +568,7 @@
         LdapDN dn = new LdapDN( "a = b, c = d" );
         LdapDN dn2 = new LdapDN( "e = f" );
         dn.addAll( 1, dn2 );
-        Assert.assertEquals( "a = b,e = f, c = d", dn.getName() );
+        Assert.assertEquals( "a = b,e = f, c = d", dn.getUpName() );
     }
 
 
@@ -542,7 +583,7 @@
         LdapDN dn2 = new LdapDN();
         dn.addAll( 0, dn2 );
         Assert.assertEquals( "a=b", dn.toString() );
-        Assert.assertEquals( "a = b", dn.getName() );
+        Assert.assertEquals( "a = b", dn.getUpName() );
     }
 
 
@@ -556,7 +597,7 @@
         LdapDN dn = new LdapDN();
         LdapDN dn2 = new LdapDN( "a = b" );
         dn.addAll( 0, dn2 );
-        Assert.assertEquals( "a = b", dn.getName() );
+        Assert.assertEquals( "a = b", dn.getUpName() );
     }
 
 
@@ -568,7 +609,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 0 ) );
-        Assert.assertEquals( "", newDn.getName() );
+        Assert.assertEquals( "", newDn.getUpName() );
     }
 
 
@@ -579,7 +620,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 1 ) );
-        Assert.assertEquals( "e = f", newDn.getName() );
+        Assert.assertEquals( "e = f", newDn.getUpName() );
     }
 
 
@@ -590,7 +631,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 2 ) );
-        Assert.assertEquals( " c=d,e = f", newDn.getName() );
+        Assert.assertEquals( " c=d,e = f", newDn.getUpName() );
     }
 
 
@@ -601,7 +642,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 3 ) );
-        Assert.assertEquals( "a=b, c=d,e = f", newDn.getName() );
+        Assert.assertEquals( "a=b, c=d,e = f", newDn.getUpName() );
     }
 
 
@@ -632,7 +673,7 @@
     {
         LdapDN dn = new LdapDN();
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 0 ) );
-        Assert.assertEquals( "", newDn.getName() );
+        Assert.assertEquals( "", newDn.getUpName() );
     }
 
 
@@ -644,7 +685,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 0 ) );
-        Assert.assertEquals( "a=b, c=d,e = f", newDn.getName() );
+        Assert.assertEquals( "a=b, c=d,e = f", newDn.getUpName() );
     }
 
 
@@ -655,7 +696,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 1 ) );
-        Assert.assertEquals( "a=b, c=d", newDn.getName() );
+        Assert.assertEquals( "a=b, c=d", newDn.getUpName() );
     }
 
 
@@ -666,7 +707,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 2 ) );
-        Assert.assertEquals( "a=b", newDn.getName() );
+        Assert.assertEquals( "a=b", newDn.getUpName() );
     }
 
 
@@ -677,7 +718,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 3 ) );
-        Assert.assertEquals( "", newDn.getName() );
+        Assert.assertEquals( "", newDn.getUpName() );
     }
 
 
@@ -708,7 +749,7 @@
     {
         LdapDN dn = new LdapDN();
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 0 ) );
-        Assert.assertEquals( "", newDn.getName() );
+        Assert.assertEquals( "", newDn.getUpName() );
     }
 
 
@@ -974,7 +1015,7 @@
         LdapDN dn = new LdapDN();
         LdapDN clone = ( LdapDN ) dn.clone();
 
-        Assert.assertEquals( "", clone.getName() );
+        Assert.assertEquals( "", clone.getUpName() );
     }
 
 
@@ -986,9 +1027,9 @@
         LdapDN dn = new LdapDN( "a=b" );
         LdapDN clone = ( LdapDN ) dn.clone();
 
-        Assert.assertEquals( "a=b", clone.getName() );
+        Assert.assertEquals( "a=b", clone.getUpName() );
         dn.remove( 0 );
-        Assert.assertEquals( "a=b", clone.getName() );
+        Assert.assertEquals( "a=b", clone.getUpName() );
     }
 
 
@@ -1000,9 +1041,9 @@
         LdapDN dn = new LdapDN( "e=f+g=h,a=b,c=d" );
         LdapDN clone = ( LdapDN ) dn.clone();
 
-        Assert.assertEquals( "e=f+g=h,a=b,c=d", clone.getName() );
+        Assert.assertEquals( "e=f+g=h,a=b,c=d", clone.getUpName() );
         dn.remove( 2 );
-        Assert.assertEquals( "e=f+g=h,a=b,c=d", clone.getName() );
+        Assert.assertEquals( "e=f+g=h,a=b,c=d", clone.getUpName() );
     }
 
 
@@ -1182,24 +1223,12 @@
     {
         Name name = LdapDnParser.getNameParser().parse( "CN = Emmanuel  Lécharny" );
 
-        Assert.assertEquals( "CN = Emmanuel  Lécharny", ( ( LdapDN ) name ).getName() );
+        Assert.assertEquals( "CN = Emmanuel  Lécharny", ( ( LdapDN ) name ).getUpName() );
         Assert.assertEquals( "cn=Emmanuel  Lécharny", name.toString() );
     }
 
 
     /**
-     * @throws Exception
-     *             if anything goes wrong.
-     */
-    public void testHashCode() throws Exception
-    {
-        String strName = "cn=HomeDir,cn=John,ou=Marketing,ou=East";
-        Name name = new LdapDN( strName );
-        assertEquals( name.hashCode(), strName.hashCode() );
-    }
-
-
-    /**
      * Class to test for void LdapName(String)
      * 
      * @throws Exception
@@ -2053,7 +2082,7 @@
         list.add( "ou= Some   People   " );
         list.add( "dc = eXample" );
         list.add( "dc= cOm" );
-        Name name = new LdapDN( list.iterator() );
+        LdapDN name = new LdapDN( list.iterator() );
 
         Map oids = new HashMap();
 
@@ -2064,7 +2093,8 @@
         oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
 
-        Name result = LdapDN.normalize( name, oids );
+        LdapDN.setOidsMap( oids );
+        Name result = LdapDN.normalize( name );
 
         assertTrue( result.toString().equals( "ou=some people,dc=example,dc=com" ) );
         assertTrue( ( ( LdapDN ) result ).toUpName().equals( "ou= Some   People   ,dc = eXample,dc= cOm" ) );
@@ -2076,7 +2106,7 @@
      */
     public void testLdapNameToNameEmpty() throws Exception
     {
-        Name name = new LdapDN();
+        LdapDN name = new LdapDN();
 
         Map oids = new HashMap();
 
@@ -2087,7 +2117,8 @@
         oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
 
-        Name result = LdapDN.normalize( name, oids );
+        LdapDN.setOidsMap( oids );
+        Name result = LdapDN.normalize( name );
         assertTrue( result.toString().equals( "" ) );
     }
 
@@ -2097,7 +2128,7 @@
      */
     public void testLdapNameToNameMultiNC() throws Exception
     {
-        Name name = new LdapDN(
+        LdapDN name = new LdapDN(
             "2.5.4.11= Some   People   + 0.9.2342.19200300.100.1.25=  And   Some anImAls,0.9.2342.19200300.100.1.25 = eXample,dc= cOm" );
 
         Map oids = new HashMap();
@@ -2109,7 +2140,8 @@
         oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
 
-        Name result = LdapDN.normalize( name, oids );
+        LdapDN.setOidsMap( oids );
+        Name result = LdapDN.normalize( name );
 
         assertTrue( result.toString().equals( "dc=and some animals+ou=some people,dc=example,dc=com" ) );
         assertTrue( ( ( LdapDN ) result )
@@ -2124,7 +2156,7 @@
      */
     public void testLdapNameToNameAliasMultiNC() throws Exception
     {
-        Name name = new LdapDN(
+        LdapDN name = new LdapDN(
             "2.5.4.11= Some   People   + domainComponent=  And   Some anImAls,DomainComponent = eXample,0.9.2342.19200300.100.1.25= cOm" );
 
         Map oids = new HashMap();
@@ -2136,7 +2168,8 @@
         oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
 
-        Name result = LdapDN.normalize( name, oids );
+        LdapDN.setOidsMap( oids );
+        LdapDN result = LdapDN.normalize( name );
 
         assertTrue( result.toString().equals( "dc=and some animals+ou=some people,dc=example,dc=com" ) );
         assertTrue( ( ( LdapDN ) result )
@@ -2153,7 +2186,7 @@
      */
     public void testNameSerialization() throws Exception
     {
-        Name name = new LdapDN( "ou= Some   People   + dc=  And   Some anImAls,dc = eXample,dc= cOm" );
+        LdapDN name = new LdapDN( "ou= Some   People   + dc=  And   Some anImAls,dc = eXample,dc= cOm" );
 
         FileOutputStream fOut = null;
         ObjectOutputStream oOut = null;
@@ -2212,5 +2245,19 @@
                 throw ioe;
             }
         }
+    }
+
+    /**
+     * Class to test for hashCode()
+     */
+    public void testLdapNameHashCode() throws Exception
+    {
+        Name name1 = new LdapDN(
+            "2.5.4.11= Some   People   + domainComponent=  And   Some anImAls,DomainComponent = eXample,0.9.2342.19200300.100.1.25= cOm" );
+
+        Name name2 = new LdapDN(
+            "2.5.4.11=some people+domainComponent=and some animals,DomainComponent=example,0.9.2342.19200300.100.1.25=com" );
+
+        assertEquals( name1.hashCode(), name2.hashCode() );
     }
 }

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java?rev=414013&r1=414012&r2=414013&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java Tue Jun 13 18:00:35 2006
@@ -56,7 +56,7 @@
     {
         NameParser dnParser = LdapDnParser.getNameParser();
 
-        Assert.assertEquals( "", ( ( LdapDN ) dnParser.parse( "" ) ).getName() );
+        Assert.assertEquals( "", ( ( LdapDN ) dnParser.parse( "" ) ).getUpName() );
     }
 
 
@@ -67,7 +67,7 @@
     {
         NameParser dnParser = LdapDnParser.getNameParser();
 
-        Assert.assertEquals( "a = b", ( ( LdapDN ) dnParser.parse( "a = b" ) ).getName() );
+        Assert.assertEquals( "a = b", ( ( LdapDN ) dnParser.parse( "a = b" ) ).getUpName() );
         Assert.assertEquals( "a=b", ( ( LdapDN ) dnParser.parse( "a = b" ) ).toString() );
     }
 
@@ -80,7 +80,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = b, c = d" );
         Assert.assertEquals( "a=b,c=d", dn.toString() );
-        Assert.assertEquals( "a = b, c = d", dn.getName() );
+        Assert.assertEquals( "a = b, c = d", dn.getUpName() );
     }
 
 
@@ -92,7 +92,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a=b, a =b, a= b, a = b, a  =  b" );
         Assert.assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.toString() );
-        Assert.assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
+        Assert.assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getUpName() );
     }
 
 
@@ -105,7 +105,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a=b;c=d,e=f" );
         Assert.assertEquals( "a=b,c=d,e=f", dn.toString() );
-        Assert.assertEquals( "a=b;c=d,e=f", dn.getName() );
+        Assert.assertEquals( "a=b;c=d,e=f", dn.getUpName() );
     }
 
 
@@ -117,7 +117,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = b + c = d" );
         Assert.assertEquals( "a=b+c=d", dn.toString() );
-        Assert.assertEquals( "a = b + c = d", dn.getName() );
+        Assert.assertEquals( "a = b + c = d", dn.getUpName() );
     }
 
 
@@ -130,7 +130,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a=b+c=d, e=f + g=h + i=j" );
         Assert.assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.toString() );
-        Assert.assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() );
+        Assert.assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getUpName() );
     }
 
 
@@ -142,7 +142,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "OID.12.34.56 = azerty" );
         Assert.assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        Assert.assertEquals( "OID.12.34.56 = azerty", dn.getName() );
+        Assert.assertEquals( "OID.12.34.56 = azerty", dn.getUpName() );
     }
 
 
@@ -154,7 +154,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "oid.12.34.56 = azerty" );
         Assert.assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        Assert.assertEquals( "oid.12.34.56 = azerty", dn.getName() );
+        Assert.assertEquals( "oid.12.34.56 = azerty", dn.getUpName() );
     }
 
 
@@ -167,7 +167,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "12.34.56 = azerty" );
         Assert.assertEquals( "12.34.56=azerty", dn.toString() );
-        Assert.assertEquals( "12.34.56 = azerty", dn.getName() );
+        Assert.assertEquals( "12.34.56 = azerty", dn.getUpName() );
     }
 
 
@@ -180,7 +180,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "12.34.56 = azerty; 7.8 = test" );
         Assert.assertEquals( "12.34.56=azerty,7.8=test", dn.toString() );
-        Assert.assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() );
+        Assert.assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getUpName() );
     }
 
 
@@ -192,7 +192,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00" );
         Assert.assertEquals( "a=\\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.toString() );
-        Assert.assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.getName() );
+        Assert.assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.getUpName() );
     }
 
 
@@ -204,7 +204,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = #0010A0AAFF" );
         Assert.assertEquals( "a=#0010A0AAFF", dn.toString() );
-        Assert.assertEquals( "a = #0010A0AAFF", dn.getName() );
+        Assert.assertEquals( "a = #0010A0AAFF", dn.getUpName() );
     }
 
 
@@ -216,7 +216,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = quoted \\\"value" );
         Assert.assertEquals( "a=quoted \\\"value", dn.toString() );
-        Assert.assertEquals( "a = quoted \\\"value", dn.getName() );
+        Assert.assertEquals( "a = quoted \\\"value", dn.getUpName() );
     }
 
 
@@ -240,7 +240,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN name = ( LdapDN ) dnParser.parse( "CN = Emmanuel  Lécharny" );
 
-        Assert.assertEquals( "CN = Emmanuel  Lécharny", name.getName() );
+        Assert.assertEquals( "CN = Emmanuel  Lécharny", name.getUpName() );
         Assert.assertEquals( "cn=Emmanuel  Lécharny", name.toString() );
     }
 
@@ -253,7 +253,7 @@
 
         Assert.assertEquals(
             "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US", name
-                .getName() );
+                .getUpName() );
         Assert.assertEquals(
             "cn=Billy Bakers,oid.2.5.4.11=Corporate Tax,ou=Fin-Accounting,ou=Americas,ou=Search,o=IMC,c=US", name
                 .toString() );



Mime
View raw message