directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r896579 [9/14] - in /directory/shared/trunk: ./ ldap/ ldap/src/main/antlr/ ldap/src/main/java/org/apache/directory/shared/ldap/ ldap/src/main/java/org/apache/directory/shared/ldap/codec/ ldap/src/main/java/org/apache/directory/shared/ldap/c...
Date Wed, 06 Jan 2010 17:52:31 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifRevertorTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifRevertorTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifRevertorTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifRevertorTest.java Wed Jan  6 17:52:15 2010
@@ -21,9 +21,9 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -79,7 +79,7 @@
         LdifEntry reversed = LdifRevertor.reverseAdd( dn );
         
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Delete, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
     }
@@ -109,7 +109,7 @@
         LdifEntry reversed = LdifRevertor.reverseDel( dn, deletedEntry );
         
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Add, reversed.getChangeType() );
         assertNotNull( reversed.getEntry() );
         assertEquals( deletedEntry, reversed.getEntry() );
@@ -138,7 +138,7 @@
                 Collections.<Modification>singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         
@@ -183,7 +183,7 @@
 
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         
@@ -226,7 +226,7 @@
 
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         
@@ -275,7 +275,7 @@
 
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         
@@ -317,7 +317,7 @@
                 Collections.<Modification>singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         
@@ -361,7 +361,7 @@
                 Collections.<Modification>singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         
@@ -454,7 +454,7 @@
      * 
      */
     @Test
-    public void testReverseMultipleModifications() throws NamingException
+    public void testReverseMultipleModifications() throws Exception
     {
         String initialEntryLdif = 
                 "dn: cn=test, ou=system\n" + 
@@ -468,6 +468,7 @@
         
         LdifReader reader = new LdifReader();
         List<LdifEntry> entries = reader.parseLdif( initialEntryLdif );
+        reader.close();
         
         LdifEntry initialEntry = entries.get( 0 );
  
@@ -532,7 +533,8 @@
     
         reader = new LdifReader();
         entries = reader.parseLdif( expectedEntryLdif );
-    
+        reader.close();
+
         LdifEntry expectedEntry = entries.get( 0 );
         
         assertEquals( expectedEntry, reversedEntry );
@@ -562,7 +564,7 @@
                 Collections.<Modification>singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         List<Modification> mods = reversed.getModificationItems();
@@ -599,7 +601,7 @@
                 Collections.<Modification>singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         List<Modification> mods = reversed.getModificationItems();
@@ -630,7 +632,7 @@
         LdapDN dn = new LdapDN( "dc=Emmanuel L\u00c9charny" );
         LdifEntry reversed = LdifRevertor.reverseAdd( dn );
         assertNotNull( reversed );
-        assertEquals( dn.getUpName(), reversed.getDn().getUpName() );
+        assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Delete, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
     }
@@ -659,7 +661,7 @@
 
         assertNotNull( reversed );
         
-        assertEquals( "cn=john doe,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=john doe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModDn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( rdn.getUpName(), reversed.getNewRdn() );
@@ -703,7 +705,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -747,7 +749,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=small,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -790,7 +792,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -834,7 +836,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=small,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -879,7 +881,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -925,7 +927,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=big,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -970,7 +972,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1016,7 +1018,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=big,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1060,7 +1062,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1104,7 +1106,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1149,7 +1151,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1194,7 +1196,7 @@
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=small,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1202,7 +1204,7 @@
 
         reversed = reverseds.get( 1 );
         
-        assertEquals( "cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationItemsArray();
         
@@ -1252,7 +1254,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1297,7 +1299,7 @@
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=small,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1305,7 +1307,7 @@
         
         reversed = reverseds.get( 1 );
         
-        assertEquals( "cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationItemsArray();
         
@@ -1355,7 +1357,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1402,7 +1404,7 @@
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=small+cn=test+cn=big,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small+cn=test+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1410,7 +1412,7 @@
 
         reversed = reverseds.get( 1 );
         
-        assertEquals( "cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationItemsArray();
         
@@ -1460,7 +1462,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1505,7 +1507,7 @@
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=small+cn=test+cn=big,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small+cn=test+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1513,7 +1515,7 @@
 
         reversed = reverseds.get( 1 );
         
-        assertEquals( "cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationItemsArray();
         
@@ -1564,7 +1566,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1610,7 +1612,7 @@
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=big,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1618,7 +1620,7 @@
 
         reversed = reverseds.get( 1 );
         
-        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationItemsArray();
         
@@ -1669,7 +1671,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1715,7 +1717,7 @@
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=big,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1723,7 +1725,7 @@
 
         reversed = reverseds.get( 1 );
         
-        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationItemsArray();
         
@@ -1774,7 +1776,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1820,7 +1822,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=big+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=big+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1866,7 +1868,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=joe+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=joe+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );
@@ -1912,7 +1914,7 @@
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
         
-        assertEquals( "cn=big+cn=test,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=big+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getUpName(), reversed.getNewRdn() );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java Wed Jan  6 17:52:15 2010
@@ -19,21 +19,14 @@
  */
 package org.apache.directory.shared.ldap.ldif;
 
-import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
-import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
-import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
-import org.apache.directory.shared.ldap.util.StringTools;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import org.junit.Test;
+import java.util.List;
 
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -41,7 +34,14 @@
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.BasicAttributes;
 
-import java.util.List;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
+import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.Test;
 
 
 /**
@@ -336,18 +336,6 @@
     @Test
     public void testConvertToLdif() throws NamingException
     {
-        String expected = 
-            "dn:: Y249U2Fhcm\n" +
-            " Jyw7xja2VuLCBk\n" +
-            " Yz1leGFtcGxlLC\n" +
-            " BkYz1jb20=\n" +
-            "changeType: Add\n" +
-            "sn: test\n" +
-            "cn:: U2FhcmJyw7\n xja2Vu\n" +
-            "objectClass: to\n p\n" +
-            "objectClass: pe\n rson\n" +
-            "objectClass: in\n etorgPerson\n\n";
-        
         LdifEntry entry = new LdifEntry();
         entry.setDn( "cn=Saarbr\u00FCcken, dc=example, dc=com" );
         entry.setChangeType( ChangeType.Add );
@@ -360,7 +348,7 @@
         entry.addAttribute( "cn", "Saarbr\u00FCcken" );
         entry.addAttribute( "sn", "test" );
 
-        String ldif = LdifUtils.convertToLdif( entry, 15 );
+        LdifUtils.convertToLdif( entry, 15 );
         //Attributes result = LdifUtils.convertFromLdif( ldif );
         //assertEquals( entry, result );
     }
@@ -372,13 +360,6 @@
     @Test
     public void testConvertAttributesfromLdif() throws NamingException
     {
-        String expected = 
-            "sn: test\n" +
-            "cn: Saarbrucke\n n\n" +
-            "objectClass: to\n p\n" +
-            "objectClass: pe\n rson\n" +
-            "objectClass: in\n etorgPerson\n\n";
-        
         Attributes attributes = new BasicAttributes( true );
         
         Attribute oc = new BasicAttribute( "objectclass" );
@@ -422,7 +403,7 @@
         assertEquals( 1, reverseds.size() );
         
         LdifEntry reversed = reverseds.get( 0 );
-        assertEquals( "cn=jack doe,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=jack doe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( "cn=john doe", reversed.getNewRdn() );
@@ -454,7 +435,7 @@
         assertEquals( 1, reverseds.size() );
         
         LdifEntry reversed = reverseds.get( 0 );
-        assertEquals( "cn=jack doe,ou=system", reversed.getDn().getUpName() );
+        assertEquals( "cn=jack doe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( "cn=john doe", reversed.getNewRdn() );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/FastLdapDnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/FastLdapDnParserTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/FastLdapDnParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/FastLdapDnParserTest.java Wed Jan  6 17:52:15 2010
@@ -25,11 +25,12 @@
 import javax.naming.NameParser;
 import javax.naming.NamingException;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
 import org.apache.directory.shared.ldap.util.StringTools;
-
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertNotNull;
 
 /**
  * Tests the fast DN parser.
@@ -40,16 +41,17 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 696620 $, $Date: 2008-09-18 12:09:30 +0200 (Do, 18 Sep 2008) $, 
  */
-public class FastLdapDnParserTest extends TestCase
+public class FastLdapDnParserTest
 {
 
     /**
      * test an empty DN
      */
+    @Test
     public void testLdapDNEmpty() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
-        Assert.assertEquals( "", ( ( LdapDN ) dnParser.parse( "" ) ).getUpName() );
+        assertEquals( "", ( ( LdapDN ) dnParser.parse( "" ) ).getName() );
     }
 
 
@@ -57,6 +59,7 @@
      * Tests incomplete DNs, used to check that the parser does not 
      * run into infinite loops.
      */
+    @Test
     public void testLdapDNIncomplete() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -151,35 +154,52 @@
     /**
      * test a simple DN : a = b
      */
+    @Test
     public void testLdapDNSimple() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
-        Assert.assertEquals( "a = b", ( ( LdapDN ) dnParser.parse( "a = b" ) ).getUpName() );
-        Assert.assertEquals( "a=b", ( ( LdapDN ) dnParser.parse( "a = b" ) ).toString() );
+        LdapDN dn = ( LdapDN ) dnParser.parse( "a = b" );
+
+        assertEquals( "a = b", dn.getName() );
+        assertEquals( "a=b", dn.getNormName() );
+        assertEquals( "a=b", dn.toString() );
+
+        assertEquals( "a = b", dn.getRdn().getUpName() );
+        assertEquals( "a=b", dn.getRdn().getNormName() );
+
+        assertEquals( "a = b", dn.getRdn().getAtav().getUpName() );
+        assertEquals( "a=b", dn.getRdn().getAtav().getNormName() );
+
+        assertEquals( "a", dn.getRdn().getAtav().getUpType() );
+        assertEquals( "a", dn.getRdn().getAtav().getNormType() );
+        assertEquals( "b", dn.getRdn().getAtav().getUpValue().get() );
+        assertEquals( "b", dn.getRdn().getAtav().getNormValue().get() );
     }
 
 
     /**
      * test a composite DN : a = b, d = e
      */
+    @Test
     public void testLdapDNComposite() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.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.getUpName() );
+        assertEquals( "a=b,c=d", dn.toString() );
+        assertEquals( "a = b, c = d", dn.getName() );
     }
 
 
     /**
      * test a composite DN with or without spaces: a=b, a =b, a= b, a = b, a = b
      */
+    @Test
     public void testLdapDNCompositeWithSpace() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.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.getUpName() );
+        assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.toString() );
+        assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
     }
 
 
@@ -187,18 +207,20 @@
      * test a composite DN with differents separators : a=b;c=d,e=f It should
      * return a=b,c=d,e=f (the ';' is replaced by a ',')
      */
+    @Test
     public void testLdapDNCompositeSepators() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.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.getUpName() );
+        assertEquals( "a=b,c=d,e=f", dn.toString() );
+        assertEquals( "a=b;c=d,e=f", dn.getName() );
     }
 
 
     /**
      * test a simple DN with multiple NameComponents : a = b + c = d
      */
+    @Test
     public void testLdapDNSimpleMultivaluedAttribute() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -218,6 +240,7 @@
      * test a composite DN with multiple NC and separators : a=b+c=d, e=f + g=h +
      * i=j
      */
+    @Test
     public void testLdapDNCompositeMultivaluedAttribute() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -236,6 +259,7 @@
     /**
      * test a simple DN with an oid prefix (uppercase) : OID.12.34.56 = azerty
      */
+    @Test
     public void testLdapDNOidUpper() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -254,6 +278,7 @@
     /**
      * test a simple DN with an oid prefix (lowercase) : oid.12.34.56 = azerty
      */
+    @Test
     public void testLdapDNOidLower() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -273,12 +298,13 @@
      * test a simple DN with an oid attribut without oid prefix : 12.34.56 =
      * azerty
      */
+    @Test
     public void testLdapDNOidWithoutPrefix() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.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.getUpName() );
+        assertEquals( "12.34.56=azerty", dn.toString() );
+        assertEquals( "12.34.56 = azerty", dn.getName() );
     }
 
 
@@ -286,18 +312,20 @@
      * test a composite DN with an oid attribut wiithout oid prefix : 12.34.56 =
      * azerty; 7.8 = test
      */
+    @Test
     public void testLdapDNCompositeOidWithoutPrefix() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.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.getUpName() );
+        assertEquals( "12.34.56=azerty,7.8=test", dn.toString() );
+        assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() );
     }
 
 
     /**
      * test a simple DN with pair char attribute value : a = \,\=\+\<\>\#\;\\\"\C3\A9"
      */
+    @Test
     public void testLdapDNPairCharAttributeValue() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -316,6 +344,7 @@
     /**
      * test a simple DN with hexString attribute value : a = #0010A0AAFF
      */
+    @Test
     public void testLdapDNHexStringAttributeValue() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -334,6 +363,7 @@
     /**
      * test exception from illegal hexString attribute value : a=#zz.
      */
+    @Test
     public void testBadLdapDNHexStringAttributeValue() throws NamingException
     {
         try
@@ -352,6 +382,7 @@
     /**
      * test a simple DN with quoted attribute value : a = "quoted \"value"
      */
+    @Test
     public void testLdapDNQuotedAttributeValue() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -370,6 +401,7 @@
     /**
      * Test the encoding of a LdanDN
      */
+    @Test
     public void testNameToBytes() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -377,11 +409,12 @@
 
         byte[] bytes = LdapDN.getBytes( dn );
 
-        Assert.assertEquals( 30, bytes.length );
-        Assert.assertEquals( "cn=John,ou=People,ou=Marketing", StringTools.utf8ToString( bytes ) );
+        assertEquals( 30, bytes.length );
+        assertEquals( "cn=John,ou=People,ou=Marketing", StringTools.utf8ToString( bytes ) );
     }
 
 
+    @Test
     public void testStringParser() throws NamingException
     {
         String dn = StringTools.utf8ToString( new byte[]
@@ -391,11 +424,12 @@
         NameParser dnParser = FastLdapDnParser.getNameParser();
         LdapDN name = ( LdapDN ) dnParser.parse( dn );
 
-        Assert.assertEquals( dn, name.getUpName() );
-        Assert.assertEquals( "cn=Emmanuel  L\u00e9charny", name.toString() );
+        assertEquals( dn, name.getName() );
+        assertEquals( "cn=Emmanuel  L\u00e9charny", name.toString() );
     }
 
 
+    @Test
     public void testStringParserShort() throws NamingException
     {
         String dn = StringTools.utf8ToString( new byte[]
@@ -404,11 +438,12 @@
         NameParser dnParser = FastLdapDnParser.getNameParser();
         LdapDN name = ( LdapDN ) dnParser.parse( dn );
 
-        Assert.assertEquals( dn, name.getUpName() );
-        Assert.assertEquals( "c=E\u00e9c", name.toString() );
+        assertEquals( dn, name.getName() );
+        assertEquals( "c=E\u00e9c", name.toString() );
     }
 
 
+    @Test
     public void testVsldapExtras() throws NamingException
     {
         NameParser dnParser = FastLdapDnParser.getNameParser();
@@ -431,6 +466,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testDnParser()
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -445,6 +481,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringEmpty() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -461,6 +498,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringNull() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -477,6 +515,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC1779_1() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -486,7 +525,7 @@
 
         assertEquals( "RFC1779_1 : ",
             "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US",
-            ( ( LdapDN ) nameRFC1779_1 ).getUpName() );
+            ( ( LdapDN ) nameRFC1779_1 ).getName() );
         assertEquals( "RFC1779_1 : ", "cn=Marshall T. Rose,o=Dover Beach Consulting,l=Santa Clara,st=California,c=US",
             nameRFC1779_1.toString() );
     }
@@ -498,13 +537,14 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_1() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
 
         Name nameRFC2253_1 = parser.parse( "CN=Steve Kille,O=Isode limited,C=GB" );
 
-        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( ( LdapDN ) nameRFC2253_1 ).getUpName() );
+        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( ( LdapDN ) nameRFC2253_1 ).getName() );
     }
 
 
@@ -514,6 +554,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_2() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -536,6 +577,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_3() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -558,6 +600,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_4() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -580,6 +623,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_5() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -602,6 +646,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseStringRFC2253_6() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -624,6 +669,7 @@
      * @throws NamingException
      *             if anything goes wrong
      */
+    @Test
     public final void testParseInvalidString()
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -649,6 +695,7 @@
      * @throws NamingException
      *             if anything goes wrong on parse()
      */
+    @Test
     public final void testPreserveSpaceAfterEscape() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -665,6 +712,7 @@
     }
 
 
+    @Test
     public void testWindowsFilePath() throws Exception
     {
         // '\' should be escaped as stated in RFC 2253
@@ -682,6 +730,7 @@
     }
 
 
+    @Test
     public void testNameFrenchChars() throws Exception
     {
         String cn = new String( new byte[]
@@ -696,6 +745,7 @@
     }
 
 
+    @Test
     public void testNameGermanChars() throws Exception
     {
         String cn = new String( new byte[]
@@ -710,6 +760,7 @@
     }
 
 
+    @Test
     public void testNameTurkishChars() throws Exception
     {
         String cn = new String( new byte[]
@@ -726,6 +777,7 @@
     }
 
 
+    @Test
     public void testAUmlautPlusBytes() throws Exception
     {
         String cn = new String( new byte[]
@@ -743,6 +795,7 @@
     }
 
 
+    @Test
     public void testAUmlautPlusChar() throws Exception
     {
         String cn = new String( new byte[]
@@ -768,6 +821,7 @@
      * @throws NamingException
      *             if anything goes wrong on parse()
      */
+    @Test
     public final void testNonEscapedChars() throws NamingException
     {
         NameParser parser = FastLdapDnParser.getNameParser();
@@ -784,5 +838,4 @@
             return;
         }
     }
-
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java Wed Jan  6 17:52:15 2010
@@ -20,6 +20,12 @@
 package org.apache.directory.shared.ldap.name;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -41,21 +47,12 @@
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapName;
 
-import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.LdapDnParser;
-import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertSame;
-
 
 /**
  * Test the class LdapDN
@@ -110,7 +107,7 @@
     public void testLdapDNNull()
     {
         LdapDN dn = new LdapDN();
-        assertEquals( "", dn.getUpName() );
+        assertEquals( "", dn.getName() );
         assertTrue( dn.isEmpty() );
     }
 
@@ -122,7 +119,7 @@
     public void testLdapDNEmpty() throws InvalidNameException
     {
         LdapDN dn = new LdapDN( "" );
-        assertEquals( "", dn.getUpName() );
+        assertEquals( "", dn.getName() );
         assertTrue( dn.isEmpty() );
     }
 
@@ -136,7 +133,7 @@
         LdapDN dn = new LdapDN( "a = b" );
 
         assertTrue( LdapDN.isValid( "a = b" ) );
-        assertEquals( "a = b", dn.getUpName() );
+        assertEquals( "a = b", dn.getName() );
         assertEquals( "a=b", dn.toString() );
     }
 
@@ -150,7 +147,7 @@
         LdapDN dn = new LdapDN( "a = b  " );
 
         assertTrue( LdapDN.isValid( "a = b  " ) );
-        assertEquals( "a = b  ", dn.getUpName() );
+        assertEquals( "a = b  ", dn.getName() );
         assertEquals( "a=b", dn.toString() );
     }
 
@@ -165,7 +162,7 @@
 
         assertTrue( LdapDN.isValid( "a = b, c = d" ) );
         assertEquals( "a=b,c=d", dn.toString() );
-        assertEquals( "a = b, c = d", dn.getUpName() );
+        assertEquals( "a = b, c = d", dn.getName() );
     }
 
 
@@ -179,7 +176,7 @@
 
         assertTrue( LdapDN.isValid( "a = b  , c = d" ) );
         assertEquals( "a=b,c=d", dn.toString() );
-        assertEquals( "a = b  , c = d", dn.getUpName() );
+        assertEquals( "a = b  , c = d", dn.getName() );
     }
 
 
@@ -193,7 +190,7 @@
 
         assertTrue( LdapDN.isValid( "a=b, a =b, a= b, a = b, a  =  b" ) );
         assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.toString() );
-        assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getUpName() );
+        assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
     }
 
 
@@ -208,7 +205,7 @@
 
         assertTrue( LdapDN.isValid( "a=b;c=d,e=f" ) );
         assertEquals( "a=b,c=d,e=f", dn.toString() );
-        assertEquals( "a=b;c=d,e=f", dn.getUpName() );
+        assertEquals( "a=b;c=d,e=f", dn.getName() );
     }
 
 
@@ -222,7 +219,7 @@
 
         assertTrue( LdapDN.isValid( "a = b + c = d" ) );
         assertEquals( "a=b+c=d", dn.toString() );
-        assertEquals( "a = b + c = d", dn.getUpName() );
+        assertEquals( "a = b + c = d", dn.getName() );
     }
 
 
@@ -237,7 +234,7 @@
 
         assertTrue( LdapDN.isValid( "a=b+c=d, e=f + g=h + i=j" ) );
         assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.toString() );
-        assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getUpName() );
+        assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() );
     }
 
 
@@ -253,7 +250,7 @@
         assertTrue( LdapDN.isValid( "cn=Kate Bush+sn=Bush,ou=system" ) );
         target.addAll( target.size(), dn );
         assertEquals( "cn=Kate Bush+sn=Bush,ou=system", target.toString() );
-        assertEquals( "cn=Kate Bush+sn=Bush,ou=system", target.getUpName() );
+        assertEquals( "cn=Kate Bush+sn=Bush,ou=system", target.getName() );
     }
 
 
@@ -267,7 +264,7 @@
 
         assertTrue( LdapDN.isValid( "OID.12.34.56 = azerty" ) );
         assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        assertEquals( "OID.12.34.56 = azerty", dn.getUpName() );
+        assertEquals( "OID.12.34.56 = azerty", dn.getName() );
     }
 
 
@@ -281,7 +278,7 @@
 
         assertTrue( LdapDN.isValid( "oid.12.34.56 = azerty" ) );
         assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        assertEquals( "oid.12.34.56 = azerty", dn.getUpName() );
+        assertEquals( "oid.12.34.56 = azerty", dn.getName() );
     }
 
 
@@ -296,7 +293,7 @@
 
         assertTrue( LdapDN.isValid( "12.34.56 = azerty" ) );
         assertEquals( "12.34.56=azerty", dn.toString() );
-        assertEquals( "12.34.56 = azerty", dn.getUpName() );
+        assertEquals( "12.34.56 = azerty", dn.getName() );
     }
 
 
@@ -311,7 +308,7 @@
 
         assertTrue( LdapDN.isValid( "12.34.56 = azerty; 7.8 = test" ) );
         assertEquals( "12.34.56=azerty,7.8=test", dn.toString() );
-        assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getUpName() );
+        assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() );
     }
 
 
@@ -325,7 +322,7 @@
 
         assertTrue( LdapDN.isValid( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C4\\8D" ) );
         assertEquals( "a=\\,=\\+\\<\\>#\\;\\\\\\\"\u010D", dn.toString() );
-        assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C4\\8D", dn.getUpName() );
+        assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C4\\8D", dn.getName() );
     }
 
 
@@ -339,7 +336,7 @@
 
         assertTrue( LdapDN.isValid( "SN=Lu\\C4\\8Di\\C4\\87" ) );
         assertEquals( "sn=Lu\u010Di\u0107", dn.toString() );
-        assertEquals( "SN=Lu\\C4\\8Di\\C4\\87", dn.getUpName() );
+        assertEquals( "SN=Lu\\C4\\8Di\\C4\\87", dn.getName() );
     }
 
 
@@ -353,7 +350,7 @@
 
         assertTrue( LdapDN.isValid( "a = #0010A0AAFF" ) );
         assertEquals( "a=#0010A0AAFF", dn.toString() );
-        assertEquals( "a = #0010A0AAFF", dn.getUpName() );
+        assertEquals( "a = #0010A0AAFF", dn.getName() );
     }
 
 
@@ -370,7 +367,7 @@
 
         assertTrue( LdapDN.isValid( "a = \\#123456" ) );
         assertEquals( "a=\\#123456", dn.toString() );
-        assertEquals( "a = \\#123456", dn.getUpName() );
+        assertEquals( "a = \\#123456", dn.getName() );
 
         Rdn rdn = dn.getRdn();
         assertEquals( "a = \\#123456", rdn.getUpName() );
@@ -397,7 +394,7 @@
 
         assertTrue( LdapDN.isValid( "a = \\#this is a sharp" ) );
         assertEquals( "a=\\#this is a sharp", dn.toString() );
-        assertEquals( "a = \\#this is a sharp", dn.getUpName() );
+        assertEquals( "a = \\#this is a sharp", dn.getName() );
 
         Rdn rdn = dn.getRdn();
         assertEquals( "a = \\#this is a sharp", rdn.getUpName() );
@@ -414,12 +411,12 @@
 
         assertTrue( LdapDN.isValid( "ou = \\#this is a sharp" ) );
         assertEquals( "ou=\\#this is a sharp", dn.toString() );
-        assertEquals( "ou = \\#this is a sharp", dn.getUpName() );
+        assertEquals( "ou = \\#this is a sharp", dn.getName() );
 
         // Check the normalization now
         LdapDN ndn = dn.normalize( oidOids );
 
-        assertEquals( "ou = \\#this is a sharp", ndn.getUpName() );
+        assertEquals( "ou = \\#this is a sharp", ndn.getName() );
         assertEquals( "2.5.4.11=\\#this is a sharp", ndn.toString() );
     }
 
@@ -434,11 +431,11 @@
         LdapDN dn = new LdapDN( "ou = AC\\\\DC" );
         assertTrue( LdapDN.isValid( "ou = AC\\\\DC" ) );
         assertEquals( "ou=AC\\\\DC", dn.toString() );
-        assertEquals( "ou = AC\\\\DC", dn.getUpName() );
+        assertEquals( "ou = AC\\\\DC", dn.getName() );
 
         // Check the normalization now
         LdapDN ndn = dn.normalize( oidOids );
-        assertEquals( "ou = AC\\\\DC", ndn.getUpName() );
+        assertEquals( "ou = AC\\\\DC", ndn.getName() );
         assertEquals( "2.5.4.11=ac\\\\dc", ndn.toString() );
     }
 
@@ -492,7 +489,7 @@
 
         assertTrue( LdapDN.isValid( "a = quoted \\\"value\\\"" ) );
         assertEquals( "a=quoted \\\"value\\\"", dn.toString() );
-        assertEquals( "a = quoted \\\"value\\\"", dn.getUpName() );
+        assertEquals( "a = quoted \\\"value\\\"", dn.getName() );
     }
 
 
@@ -506,7 +503,7 @@
 
         assertTrue( LdapDN.isValid( "a = \\\" quoted value \\\"" ) );
         assertEquals( "a=\\\" quoted value \\\"", dn.toString() );
-        assertEquals( "a = \\\" quoted value \\\"", dn.getUpName() );
+        assertEquals( "a = \\\" quoted value \\\"", dn.getName() );
     }
 
 
@@ -544,7 +541,7 @@
         assertTrue( LdapDN.isValid( "a=b, c=d, e=f" ) );
         assertEquals( "e=f", dn.remove( 0 ).toString() );
         assertEquals( "a=b,c=d", dn.toString() );
-        assertEquals( "a=b, c=d", dn.getUpName() );
+        assertEquals( "a=b, c=d", dn.getName() );
     }
 
 
@@ -558,7 +555,7 @@
 
         assertTrue( LdapDN.isValid( "a=b, c=d, e=f" ) );
         assertEquals( "c=d", dn.remove( 1 ).toString() );
-        assertEquals( "a=b, e=f", dn.getUpName() );
+        assertEquals( "a=b, e=f", dn.getName() );
     }
 
 
@@ -572,7 +569,7 @@
 
         assertTrue( LdapDN.isValid( "a=b, c=d, e=f" ) );
         assertEquals( "a=b", dn.remove( 2 ).toString() );
-        assertEquals( " c=d, e=f", dn.getUpName() );
+        assertEquals( " c=d, e=f", dn.getName() );
     }
 
 
@@ -586,7 +583,7 @@
 
         assertTrue( LdapDN.isValid( "a=b, c=d; e=f" ) );
         assertEquals( "c=d", dn.remove( 1 ).toString() );
-        assertEquals( "a=b, e=f", dn.getUpName() );
+        assertEquals( "a=b, e=f", dn.getName() );
     }
 
 
@@ -700,7 +697,7 @@
 
         dn.add( "e = f" );
         assertEquals( "e=f", dn.toString() );
-        assertEquals( "e = f", dn.getUpName() );
+        assertEquals( "e = f", dn.getName() );
         assertEquals( 1, dn.size() );
     }
 
@@ -715,7 +712,7 @@
 
         dn.add( "e = f" );
         assertEquals( "e=f,a=b,c=d", dn.toString() );
-        assertEquals( "e = f,a=b, c=d", dn.getUpName() );
+        assertEquals( "e = f,a=b, c=d", dn.getName() );
         assertEquals( 3, dn.size() );
     }
 
@@ -747,7 +744,7 @@
         LdapDN dn = new LdapDN( "a=b, c=d" );
 
         dn.add( dn.size(), "e = f" );
-        assertEquals( "e = f,a=b, c=d", dn.getUpName() );
+        assertEquals( "e = f,a=b, c=d", dn.getName() );
         assertEquals( 3, dn.size() );
     }
 
@@ -761,7 +758,7 @@
         LdapDN dn = new LdapDN( "a=b, c=d" );
 
         dn.add( 0, "e = f" );
-        assertEquals( "a=b, c=d,e = f", dn.getUpName() );
+        assertEquals( "a=b, c=d,e = f", dn.getName() );
         assertEquals( 3, dn.size() );
     }
 
@@ -775,7 +772,7 @@
         LdapDN dn = new LdapDN( "a=b, c=d" );
 
         dn.add( 1, "e = f" );
-        assertEquals( "a=b,e = f, c=d", dn.getUpName() );
+        assertEquals( "a=b,e = f, c=d", dn.getName() );
         assertEquals( 3, dn.size() );
     }
 
@@ -792,7 +789,7 @@
         LdapDN dn = new LdapDN( "a = b" );
         LdapDN dn2 = new LdapDN( "c = d" );
         dn.addAll( dn2 );
-        assertEquals( "c = d,a = b", dn.getUpName() );
+        assertEquals( "c = d,a = b", dn.getName() );
     }
 
 
@@ -808,7 +805,7 @@
         LdapDN dn2 = new LdapDN();
         dn.addAll( dn2 );
         assertEquals( "a=b", dn.toString() );
-        assertEquals( "a = b", dn.getUpName() );
+        assertEquals( "a = b", dn.getName() );
     }
 
 
@@ -823,7 +820,7 @@
         LdapDN dn = new LdapDN();
         LdapDN dn2 = new LdapDN( "a = b" );
         dn.addAll( dn2 );
-        assertEquals( "a = b", dn.getUpName() );
+        assertEquals( "a = b", dn.getName() );
     }
 
 
@@ -838,7 +835,7 @@
         LdapDN dn = new LdapDN( "a = b" );
         LdapDN dn2 = new LdapDN( "c = d" );
         dn.addAll( 0, dn2 );
-        assertEquals( "a = b,c = d", dn.getUpName() );
+        assertEquals( "a = b,c = d", dn.getName() );
     }
 
 
@@ -853,7 +850,7 @@
         LdapDN dn = new LdapDN( "a = b" );
         LdapDN dn2 = new LdapDN( "c = d" );
         dn.addAll( 1, dn2 );
-        assertEquals( "c = d,a = b", dn.getUpName() );
+        assertEquals( "c = d,a = b", dn.getName() );
     }
 
 
@@ -868,7 +865,7 @@
         LdapDN dn = new LdapDN( "a = b, c = d" );
         LdapDN dn2 = new LdapDN( "e = f" );
         dn.addAll( 1, dn2 );
-        assertEquals( "a = b,e = f, c = d", dn.getUpName() );
+        assertEquals( "a = b,e = f, c = d", dn.getName() );
     }
 
 
@@ -884,7 +881,7 @@
         LdapDN dn2 = new LdapDN();
         dn.addAll( 0, dn2 );
         assertEquals( "a=b", dn.toString() );
-        assertEquals( "a = b", dn.getUpName() );
+        assertEquals( "a = b", dn.getName() );
     }
 
 
@@ -899,7 +896,7 @@
         LdapDN dn = new LdapDN();
         LdapDN dn2 = new LdapDN( "a = b" );
         dn.addAll( 0, dn2 );
-        assertEquals( "a = b", dn.getUpName() );
+        assertEquals( "a = b", dn.getName() );
     }
 
 
@@ -912,7 +909,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 0 ) );
-        assertEquals( "", newDn.getUpName() );
+        assertEquals( "", newDn.getName() );
     }
 
 
@@ -924,7 +921,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 1 ) );
-        assertEquals( "e = f", newDn.getUpName() );
+        assertEquals( "e = f", newDn.getName() );
     }
 
 
@@ -936,7 +933,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 2 ) );
-        assertEquals( " c=d,e = f", newDn.getUpName() );
+        assertEquals( " c=d,e = f", newDn.getName() );
     }
 
 
@@ -948,7 +945,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 3 ) );
-        assertEquals( "a=b, c=d,e = f", newDn.getUpName() );
+        assertEquals( "a=b, c=d,e = f", newDn.getName() );
     }
 
 
@@ -981,7 +978,7 @@
     {
         LdapDN dn = new LdapDN();
         LdapDN newDn = ( ( LdapDN ) dn.getPrefix( 0 ) );
-        assertEquals( "", newDn.getUpName() );
+        assertEquals( "", newDn.getName() );
     }
 
 
@@ -994,7 +991,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 0 ) );
-        assertEquals( "a=b, c=d,e = f", newDn.getUpName() );
+        assertEquals( "a=b, c=d,e = f", newDn.getName() );
     }
 
 
@@ -1006,7 +1003,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 1 ) );
-        assertEquals( "a=b, c=d", newDn.getUpName() );
+        assertEquals( "a=b, c=d", newDn.getName() );
     }
 
 
@@ -1018,7 +1015,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 2 ) );
-        assertEquals( "a=b", newDn.getUpName() );
+        assertEquals( "a=b", newDn.getName() );
     }
 
 
@@ -1030,7 +1027,7 @@
     {
         LdapDN dn = new LdapDN( "a=b, c=d,e = f" );
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 3 ) );
-        assertEquals( "", newDn.getUpName() );
+        assertEquals( "", newDn.getName() );
     }
 
 
@@ -1063,7 +1060,7 @@
     {
         LdapDN dn = new LdapDN();
         LdapDN newDn = ( ( LdapDN ) dn.getSuffix( 0 ) );
-        assertEquals( "", newDn.getUpName() );
+        assertEquals( "", newDn.getName() );
     }
 
 
@@ -1352,7 +1349,7 @@
         LdapDN dn = new LdapDN();
         LdapDN clone = ( LdapDN ) dn.clone();
 
-        assertEquals( "", clone.getUpName() );
+        assertEquals( "", clone.getName() );
     }
 
 
@@ -1365,9 +1362,9 @@
         LdapDN dn = new LdapDN( "a=b" );
         LdapDN clone = ( LdapDN ) dn.clone();
 
-        assertEquals( "a=b", clone.getUpName() );
+        assertEquals( "a=b", clone.getName() );
         dn.remove( 0 );
-        assertEquals( "a=b", clone.getUpName() );
+        assertEquals( "a=b", clone.getName() );
     }
 
 
@@ -1380,9 +1377,9 @@
         LdapDN dn = new LdapDN( "e=f+g=h,a=b,c=d" );
         LdapDN clone = ( LdapDN ) dn.clone();
 
-        assertEquals( "e=f+g=h,a=b,c=d", clone.getUpName() );
+        assertEquals( "e=f+g=h,a=b,c=d", clone.getName() );
         dn.remove( 2 );
-        assertEquals( "e=f+g=h,a=b,c=d", clone.getUpName() );
+        assertEquals( "e=f+g=h,a=b,c=d", clone.getName() );
     }
 
 
@@ -1580,7 +1577,7 @@
 
         Name name = LdapDnParser.getNameParser().parse( dn );
 
-        assertEquals( dn, ( ( LdapDN ) name ).getUpName() );
+        assertEquals( dn, ( ( LdapDN ) name ).getName() );
         assertEquals( "cn=Emmanuel  L\u00E9charny", name.toString() );
     }
 
@@ -2516,7 +2513,7 @@
         list.add( "dc= cOm" );
         LdapDN name = new LdapDN( list.iterator() );
 
-        assertTrue( name.getUpName().equals( "ou= Some   People   ,dc = eXample,dc= cOm" ) );
+        assertTrue( name.getName().equals( "ou= Some   People   ,dc = eXample,dc= cOm" ) );
 
         Name result = LdapDN.normalize( name, oids );
 
@@ -2533,7 +2530,7 @@
         list.add( "dc= cOm" );
         LdapDN name = new LdapDN( list.iterator() );
 
-        assertTrue( name.getUpName().equals( "ou= Some   People   ,dc = eXample,dc= cOm" ) );
+        assertTrue( name.getName().equals( "ou= Some   People   ,dc = eXample,dc= cOm" ) );
 
         Rdn rdn = name.getRdn();
 
@@ -2545,7 +2542,7 @@
 
         assertTrue( result.getNormName().equals(
             "2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" ) );
-        assertTrue( name.getUpName().equals( "ou= Some   People   ,dc = eXample,dc= cOm" ) );
+        assertTrue( name.getName().equals( "ou= Some   People   ,dc = eXample,dc= cOm" ) );
 
         Rdn rdn2 = result.getRdn();
 
@@ -2583,7 +2580,7 @@
             result.toString(),
             "0.9.2342.19200300.100.1.25=and some animals+2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" );
         assertTrue( ( ( LdapDN ) result )
-            .getUpName()
+            .getName()
             .equals(
                 "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" ) );
     }
@@ -2605,7 +2602,7 @@
             .equals(
                 "0.9.2342.19200300.100.1.25=and some animals+2.5.4.11=some people,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com" ) );
         assertTrue( result
-            .getUpName()
+            .getName()
             .equals(
                 "2.5.4.11= Some   People   + domainComponent=  And   Some anImAls,DomainComponent = eXample,0.9.2342.19200300.100.1.25= cOm" ) );
     }
@@ -2939,7 +2936,7 @@
     {
         LdapDN dn = new LdapDN( "cn=\" Kylie Minogue \",dc=example,dc=com" );
 
-        assertEquals( "cn=\" Kylie Minogue \",dc=example,dc=com", dn.getUpName() );
+        assertEquals( "cn=\" Kylie Minogue \",dc=example,dc=com", dn.getName() );
         assertEquals( "cn=\\ Kylie Minogue\\ ,dc=example,dc=com", dn.toString() );
     }
 
@@ -2953,7 +2950,7 @@
     {
         LdapDN dn = new LdapDN( "a=\"b,c\"" );
 
-        assertEquals( "a=\"b,c\"", dn.getUpName() );
+        assertEquals( "a=\"b,c\"", dn.getName() );
         assertEquals( "a=b\\,c", dn.toString() );
     }
 
@@ -2968,7 +2965,7 @@
         LdapDN name = new LdapDN( "dn= \\ four spaces leading and 3 trailing \\  " );
 
         assertEquals( "dn=\\ four spaces leading and 3 trailing \\ ", name.toString() );
-        assertEquals( "dn= \\ four spaces leading and 3 trailing \\  ", name.getUpName() );
+        assertEquals( "dn= \\ four spaces leading and 3 trailing \\  ", name.getName() );
     }
 
 
@@ -3018,7 +3015,7 @@
         LdapDN name = new LdapDN( "dn=\\# a leading pound" );
 
         assertEquals( "dn=\\# a leading pound", name.toString() );
-        assertEquals( "dn=\\# a leading pound", name.getUpName() );
+        assertEquals( "dn=\\# a leading pound", name.getName() );
     }
 
 
@@ -3032,7 +3029,7 @@
         LdapDN name = new LdapDN( "dn=a middle \\# pound" );
 
         assertEquals( "dn=a middle # pound", name.toString() );
-        assertEquals( "dn=a middle \\# pound", name.getUpName() );
+        assertEquals( "dn=a middle \\# pound", name.getName() );
     }
 
 
@@ -3046,7 +3043,7 @@
         LdapDN name = new LdapDN( "dn=a trailing pound \\#" );
 
         assertEquals( "dn=a trailing pound #", name.toString() );
-        assertEquals( "dn=a trailing pound \\#", name.getUpName() );
+        assertEquals( "dn=a trailing pound \\#", name.getName() );
     }
 
 
@@ -3092,7 +3089,7 @@
         LdapDN name = new LdapDN( "cn=Bush\\, Kate,dc=example,dc=com" );
 
         assertEquals( "cn=Bush\\, Kate,dc=example,dc=com", name.toString() );
-        assertEquals( "cn=Bush\\, Kate,dc=example,dc=com", name.getUpName() );
+        assertEquals( "cn=Bush\\, Kate,dc=example,dc=com", name.getName() );
 
     }
 
@@ -3112,7 +3109,7 @@
                 .toString() );
         assertEquals(
             "0.9.2342.19200300.100.1.1=00123456789+2.5.4.3=pablo picasso,2.5.4.11=search,2.5.4.10=imc,2.5.4.6=us", name
-                .getUpName() );
+                .getName() );
     }
 
 
@@ -3401,38 +3398,38 @@
         // antlr parser: string value with trailing spaces
         LdapDN dn1 = new LdapDN( " cn = Amos\\,Tori , ou=system " );
         assertEquals( " cn = Amos\\,Tori ", dn1.getRdn().getUpName() );
-        AttributeTypeAndValue atav1 = dn1.getRdn().getAtav();
+        AVA atav1 = dn1.getRdn().getAtav();
         assertEquals( "cn", atav1.getUpType() );
-        assertEquals( "Amos\\,Tori", atav1.getUpValue().getString() );
+        assertEquals( "Amos,Tori", atav1.getUpValue().getString() );
 
         // antlr parser: hexstring with trailing spaces
         LdapDN dn3 = new LdapDN( " cn = #414243 , ou=system " );
         assertEquals( " cn = #414243 ", dn3.getRdn().getUpName() );
-        AttributeTypeAndValue atav3 = dn3.getRdn().getAtav();
+        AVA atav3 = dn3.getRdn().getAtav();
         assertEquals( "cn", atav3.getUpType() );
-        assertEquals( "#414243", atav3.getUpValue().getString() );
+        assertEquals( "ABC", atav3.getUpValue().getString() );
         assertTrue( Arrays.equals( StringTools.getBytesUtf8( "ABC" ),atav3.getNormValue().getBytes() ) );
 
         // antlr parser: 
         LdapDN dn4 = new LdapDN( " cn = \\41\\42\\43 , ou=system " );
         assertEquals( " cn = \\41\\42\\43 ", dn4.getRdn().getUpName() );
-        AttributeTypeAndValue atav4 = dn4.getRdn().getAtav();
+        AVA atav4 = dn4.getRdn().getAtav();
         assertEquals( "cn", atav4.getUpType() );
-        assertEquals( "\\41\\42\\43", atav4.getUpValue().getString() );
+        assertEquals( "ABC", atav4.getUpValue().getString() );
         assertEquals( "ABC", atav4.getNormValue().getString() );
 
         // antlr parser: quotestring with trailing spaces
         LdapDN dn5 = new LdapDN( " cn = \"ABC\" , ou=system " );
         assertEquals( " cn = \"ABC\" ", dn5.getRdn().getUpName() );
-        AttributeTypeAndValue atav5 = dn5.getRdn().getAtav();
+        AVA atav5 = dn5.getRdn().getAtav();
         assertEquals( "cn", atav5.getUpType() );
-        assertEquals( "\"ABC\"", atav5.getUpValue().getString() );
+        assertEquals( "ABC", atav5.getUpValue().getString() );
         assertEquals( "ABC", atav5.getNormValue().getString() );
 
         // fast parser: string value with trailing spaces 
         LdapDN dn2 = new LdapDN( " cn = Amos Tori , ou=system " );
         assertEquals( " cn = Amos Tori ", dn2.getRdn().getUpName() );
-        AttributeTypeAndValue atav2 = dn2.getRdn().getAtav();
+        AVA atav2 = dn2.getRdn().getAtav();
         assertEquals( "cn", atav2.getUpType() );
         assertEquals( "Amos Tori", atav2.getUpValue().getString() );
     }
@@ -3446,28 +3443,32 @@
     public void testTrailingEscapedSpace() throws Exception
     {
         LdapDN dn1 = new LdapDN( "ou=A\\ ,ou=system" );
-        assertEquals( "ou=A\\ ,ou=system", dn1.getUpName() );
-        assertEquals( "ou=A\\ ,ou=system", dn1.getNormName() );
+        dn1.normalize( oids );
+        assertEquals( "ou=A\\ ,ou=system", dn1.getName() );
+        assertEquals( "ou=a,ou=system", dn1.getNormName() );
         assertEquals( "ou=A\\ ", dn1.getRdn().getUpName() );
-        assertEquals( "ou=A\\ ", dn1.getRdn().getNormName() );
+        assertEquals( "ou=a", dn1.getRdn().getNormName() );
 
         LdapDN dn2 = new LdapDN( "ou=A\\20,ou=system" );
-        assertEquals( "ou=A\\20,ou=system", dn2.getUpName() );
-        assertEquals( "ou=A\\ ,ou=system", dn2.getNormName() );
+        dn2.normalize( oids );
+        assertEquals( "ou=A\\20,ou=system", dn2.getName() );
+        assertEquals( "ou=a,ou=system", dn2.getNormName() );
         assertEquals( "ou=A\\20", dn2.getRdn().getUpName() );
-        assertEquals( "ou=A\\ ", dn2.getRdn().getNormName() );
+        assertEquals( "ou=a", dn2.getRdn().getNormName() );
         
         LdapDN dn3 = new LdapDN( "ou=\\ ,ou=system" );
-        assertEquals( "ou=\\ ,ou=system", dn3.getUpName() );
-        assertEquals( "ou=\\ ,ou=system", dn3.getNormName() );
+        dn3.normalize( oids );
+        assertEquals( "ou=\\ ,ou=system", dn3.getName() );
+        assertEquals( "ou=,ou=system", dn3.getNormName() );
         assertEquals( "ou=\\ ", dn3.getRdn().getUpName() );
-        assertEquals( "ou=\\ ", dn3.getRdn().getNormName() );
+        assertEquals( "ou=", dn3.getRdn().getNormName() );
         
         LdapDN dn4 = new LdapDN( "ou=\\20,ou=system" );
-        assertEquals( "ou=\\20,ou=system", dn4.getUpName() );
-        assertEquals( "ou=\\ ,ou=system", dn4.getNormName() );
+        dn4.normalize( oids );
+        assertEquals( "ou=\\20,ou=system", dn4.getName() );
+        assertEquals( "ou=,ou=system", dn4.getNormName() );
         assertEquals( "ou=\\20", dn4.getRdn().getUpName() );
-        assertEquals( "ou=\\ ", dn4.getRdn().getNormName() );
+        assertEquals( "ou=", dn4.getRdn().getNormName() );
     }
 
 
@@ -3480,7 +3481,7 @@
     {
         // numeric OID only
         LdapDN dn1 = new LdapDN( "cn=loopback+ipHostNumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com" );
-        assertEquals( "cn=loopback+ipHostNumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn1.getUpName() );
+        assertEquals( "cn=loopback+ipHostNumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn1.getName() );
         assertEquals( "cn=loopback+iphostnumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn1.getNormName() );
         assertEquals( "cn=loopback+ipHostNumber=127.0.0.1", dn1.getRdn().getUpName() );
         assertEquals( "cn=loopback+iphostnumber=127.0.0.1", dn1.getRdn().getNormName() );
@@ -3488,24 +3489,241 @@
         
         // numeric OID with suffix
         LdapDN dn2 = new LdapDN( "cn=loopback+ipHostNumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com" );
-        assertEquals( "cn=loopback+ipHostNumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn2.getUpName() );
+        assertEquals( "cn=loopback+ipHostNumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn2.getName() );
         assertEquals( "cn=loopback+iphostnumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn2.getNormName() );
         assertEquals( "cn=loopback+ipHostNumber=X127.0.0.1", dn2.getRdn().getUpName() );
         assertEquals( "cn=loopback+iphostnumber=X127.0.0.1", dn2.getRdn().getNormName() );
 
         // numeric OID with prefix
         LdapDN dn3 = new LdapDN( "cn=loopback+ipHostNumber=127.0.0.1Y,ou=Hosts,dc=mygfs,dc=com" );
-        assertEquals( "cn=loopback+ipHostNumber=127.0.0.1Y,ou=Hosts,dc=mygfs,dc=com", dn3.getUpName() );
+        assertEquals( "cn=loopback+ipHostNumber=127.0.0.1Y,ou=Hosts,dc=mygfs,dc=com", dn3.getName() );
         assertEquals( "cn=loopback+iphostnumber=127.0.0.1Y,ou=Hosts,dc=mygfs,dc=com", dn3.getNormName() );
         assertEquals( "cn=loopback+ipHostNumber=127.0.0.1Y", dn3.getRdn().getUpName() );
         assertEquals( "cn=loopback+iphostnumber=127.0.0.1Y", dn3.getRdn().getNormName() );
 
         // numeric OID with special characters
         LdapDN dn4 = new LdapDN( "cn=loopback+ipHostNumber=\\#127.0.0.1 Z,ou=Hosts,dc=mygfs,dc=com" );
-        assertEquals( "cn=loopback+ipHostNumber=\\#127.0.0.1 Z,ou=Hosts,dc=mygfs,dc=com", dn4.getUpName() );
+        assertEquals( "cn=loopback+ipHostNumber=\\#127.0.0.1 Z,ou=Hosts,dc=mygfs,dc=com", dn4.getName() );
         assertEquals( "cn=loopback+iphostnumber=\\#127.0.0.1 Z,ou=Hosts,dc=mygfs,dc=com", dn4.getNormName() );
         assertEquals( "cn=loopback+ipHostNumber=\\#127.0.0.1 Z", dn4.getRdn().getUpName() );
         assertEquals( "cn=loopback+iphostnumber=\\#127.0.0.1 Z", dn4.getRdn().getNormName() );
     }
 
+    
+    @Test
+    public void testNormalizeAscii() throws Exception
+    {
+        LdapDN dn = new LdapDN( "  ou  =  Example ,  ou  =  COM " );
+        
+        dn.normalize( oidOids );
+        assertEquals( "2.5.4.11=example,2.5.4.11=com", dn.getNormName() );
+        assertEquals( "  ou  =  Example ,  ou  =  COM ", dn.getName() );
+        
+        Rdn rdn = dn.getRdn();
+        assertEquals( "2.5.4.11", rdn.getNormType() );
+        assertEquals( "example",rdn.getNormValue() );
+        assertEquals( "2.5.4.11=example", rdn.getNormName() );
+        assertEquals( "ou", rdn.getUpType() );
+        assertEquals( "Example",rdn.getUpValue() );
+        assertEquals( "  ou  =  Example ", rdn.getUpName() );
+        
+        AVA atav = rdn.getAtav();
+        
+        assertEquals( "2.5.4.11=example", atav.getNormName() );
+        assertEquals( "2.5.4.11", atav.getNormType() );
+        assertEquals( "example", atav.getNormValue().get() );
+        
+        assertEquals( "ou", atav.getUpType() );
+        assertEquals( "Example", atav.getUpValue().get() );
+        
+        assertEquals( "  ou  =  Example ", atav.getUpName() );
+    }
+
+    
+    @Test
+    public void testNormalizeAsciiComposite() throws Exception
+    {
+        LdapDN dn = new LdapDN( "  ou  =  Example + ou = TEST ,  ou  =  COM " );
+        
+        dn.normalize( oidOids );
+        assertEquals( "2.5.4.11=example+2.5.4.11=test,2.5.4.11=com", dn.getNormName() );
+        assertEquals( "  ou  =  Example + ou = TEST ,  ou  =  COM ", dn.getName() );
+        
+        Rdn rdn = dn.getRdn();
+        assertEquals( "2.5.4.11", rdn.getNormType() );
+        assertEquals( "example",rdn.getNormValue() );
+        assertEquals( "2.5.4.11=example+2.5.4.11=test", rdn.getNormName() );
+        assertEquals( "ou", rdn.getUpType() );
+        assertEquals( "Example",rdn.getUpValue() );
+        assertEquals( "  ou  =  Example + ou = TEST ", rdn.getUpName() );
+        
+        // The first ATAV
+        AVA atav = rdn.getAtav();
+        
+        assertEquals( "2.5.4.11=example", atav.getNormName() );
+        assertEquals( "2.5.4.11", atav.getNormType() );
+        assertEquals( "example", atav.getNormValue().get() );
+        
+        assertEquals( "ou", atav.getUpType() );
+        assertEquals( "Example", atav.getUpValue().get() );
+        
+        assertEquals( "  ou  =  Example ", atav.getUpName() );
+        
+        assertEquals( 2, rdn.getNbAtavs() );
+        
+        // The second ATAV
+        for ( AVA ava : rdn )
+        {
+            if ( "example".equals( ava.getNormValue().get() ) )
+            {
+                // Skip the first one
+                continue;
+            }
+            
+            assertEquals( "2.5.4.11=test", ava.getNormName() );
+            assertEquals( "2.5.4.11", ava.getNormType() );
+            assertEquals( "test", ava.getNormValue().get() );
+            
+            assertEquals( "ou", ava.getUpType() );
+            assertEquals( "TEST", ava.getUpValue().get() );
+            assertEquals( " ou = TEST ", ava.getUpName() );
+        }
+    }
+
+    
+    @Test
+    public void testNormalizeAsciiWithEscaped() throws Exception
+    {
+        LdapDN dn = new LdapDN( "  ou  =  Ex\\+mple ,  ou  =  COM " );
+        
+        dn.normalize( oidOids );
+        assertEquals( "2.5.4.11=ex\\+mple,2.5.4.11=com", dn.getNormName() );
+        assertEquals( "  ou  =  Ex\\+mple ,  ou  =  COM ", dn.getName() );
+        
+        Rdn rdn = dn.getRdn();
+        assertEquals( "2.5.4.11", rdn.getNormType() );
+        assertEquals( "ex+mple",rdn.getNormValue() );
+        assertEquals( "2.5.4.11=ex\\+mple", rdn.getNormName() );
+        assertEquals( "ou", rdn.getUpType() );
+        assertEquals( "Ex+mple",rdn.getUpValue() );
+        assertEquals( "  ou  =  Ex\\+mple ", rdn.getUpName() );
+        
+        AVA atav = rdn.getAtav();
+        
+        assertEquals( "2.5.4.11=ex\\+mple", atav.getNormName() );
+        assertEquals( "2.5.4.11", atav.getNormType() );
+        assertEquals( "ex+mple", atav.getNormValue().get() );
+        
+        assertEquals( "ou", atav.getUpType() );
+        assertEquals( "Ex+mple", atav.getUpValue().get() );
+        
+        assertEquals( "  ou  =  Ex\\+mple ", atav.getUpName() );
+    }
+
+    
+    @Test
+    public void testNormalizeCompositeWithEscaped() throws Exception
+    {
+        LdapDN dn = new LdapDN( "  OU  =  Ex\\+mple + ou = T\\+ST\\  ,  ou  =  COM " );
+        
+        // ------------------------------------------------------------------
+        // Before normalization
+        assertEquals( "  OU  =  Ex\\+mple + ou = T\\+ST\\  ,  ou  =  COM ", dn.getName() );
+        assertEquals( "ou=Ex\\+mple+ou=T\\+ST\\ ,ou=COM", dn.getNormName() );
+        
+        // Check the first RDN
+        Rdn rdn = dn.getRdn();
+        assertEquals( "  OU  =  Ex\\+mple + ou = T\\+ST\\  ", rdn.getUpName() );
+        assertEquals( "ou=Ex\\+mple+ou=T\\+ST\\ ", rdn.getNormName() );
+
+        assertEquals( "OU", rdn.getUpType() );
+        assertEquals( "ou", rdn.getNormType() );
+        
+        assertEquals( "Ex+mple",rdn.getUpValue() );
+        assertEquals( "Ex+mple",rdn.getNormValue() );
+        
+        // The first ATAV
+        AVA atav = rdn.getAtav();
+        
+        assertEquals( "  OU  =  Ex\\+mple ", atav.getUpName() );
+        assertEquals( "ou=Ex\\+mple", atav.getNormName() );
+        
+        assertEquals( "ou", atav.getNormType() );
+        assertEquals( "OU", atav.getUpType() );
+        
+        assertEquals( "Ex+mple", atav.getUpValue().get() );
+        assertEquals( "Ex+mple", atav.getNormValue().get() );
+        
+        assertEquals( 2, rdn.getNbAtavs() );
+        
+        // The second ATAV
+        for ( AVA ava : rdn )
+        {
+            if ( "Ex+mple".equals( ava.getNormValue().get() ) )
+            {
+                // Skip the first one
+                continue;
+            }
+            
+            assertEquals( " ou = T\\+ST\\  ", ava.getUpName() );
+            assertEquals( "ou=T\\+ST\\ ", ava.getNormName() );
+
+            assertEquals( "ou", ava.getUpType() );
+            assertEquals( "ou", ava.getNormType() );
+            
+            assertEquals( "T+ST ", ava.getUpValue().get() );
+            assertEquals( "T+ST ", ava.getNormValue().get() );
+        }
+
+        // ------------------------------------------------------------------
+        // Now normalize the DN
+        dn.normalize( oidOids );
+        
+        assertEquals( "  OU  =  Ex\\+mple + ou = T\\+ST\\  ,  ou  =  COM ", dn.getName() );
+        assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st,2.5.4.11=com", dn.getNormName() );
+        
+        // Check the first RDN
+        rdn = dn.getRdn();
+        assertEquals( "  OU  =  Ex\\+mple + ou = T\\+ST\\  ", rdn.getUpName() );
+        assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st", rdn.getNormName() );
+
+        assertEquals( "OU", rdn.getUpType() );
+        assertEquals( "2.5.4.11", rdn.getNormType() );
+        
+        assertEquals( "Ex+mple",rdn.getUpValue() );
+        assertEquals( "ex+mple",rdn.getNormValue() );
+        
+        // The first ATAV
+        atav = rdn.getAtav();
+        
+        assertEquals( "  OU  =  Ex\\+mple ", atav.getUpName() );
+        assertEquals( "2.5.4.11=ex\\+mple", atav.getNormName() );
+        
+        assertEquals( "2.5.4.11", atav.getNormType() );
+        assertEquals( "OU", atav.getUpType() );
+        
+        assertEquals( "Ex+mple", atav.getUpValue().get() );
+        assertEquals( "ex+mple", atav.getNormValue().get() );
+        
+        assertEquals( 2, rdn.getNbAtavs() );
+        
+        // The second ATAV
+        for ( AVA ava : rdn )
+        {
+            if ( "ex+mple".equals( ava.getNormValue().get() ) )
+            {
+                // Skip the first one
+                continue;
+            }
+            
+            assertEquals( " ou = T\\+ST\\  ", ava.getUpName() );
+            assertEquals( "2.5.4.11=t\\+st", ava.getNormName() );
+
+            assertEquals( "ou", ava.getUpType() );
+            assertEquals( "2.5.4.11", ava.getNormType() );
+            
+            assertEquals( "T+ST ", ava.getUpValue().get() );
+            assertEquals( "t+st", ava.getNormValue().get() );
+        }
+    }
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java Wed Jan  6 17:52:15 2010
@@ -54,7 +54,7 @@
     {
         NameParser dnParser = LdapDnParser.getNameParser();
 
-        assertEquals( "", ( ( LdapDN ) dnParser.parse( "" ) ).getUpName() );
+        assertEquals( "", ( ( LdapDN ) dnParser.parse( "" ) ).getName() );
     }
 
 
@@ -66,7 +66,7 @@
     {
         NameParser dnParser = LdapDnParser.getNameParser();
 
-        assertEquals( "a = b", ( ( LdapDN ) dnParser.parse( "a = b" ) ).getUpName() );
+        assertEquals( "a = b", ( ( LdapDN ) dnParser.parse( "a = b" ) ).getName() );
         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" );
         assertEquals( "a=b,c=d", dn.toString() );
-        assertEquals( "a = b, c = d", dn.getUpName() );
+        assertEquals( "a = b, c = d", dn.getName() );
     }
 
 
@@ -93,7 +93,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a=b, a =b, a= b, a = b, a  =  b" );
         assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.toString() );
-        assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getUpName() );
+        assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
     }
 
 
@@ -107,7 +107,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a=b;c=d,e=f" );
         assertEquals( "a=b,c=d,e=f", dn.toString() );
-        assertEquals( "a=b;c=d,e=f", dn.getUpName() );
+        assertEquals( "a=b;c=d,e=f", dn.getName() );
     }
 
 
@@ -120,7 +120,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = b + c = d" );
         assertEquals( "a=b+c=d", dn.toString() );
-        assertEquals( "a = b + c = d", dn.getUpName() );
+        assertEquals( "a = b + c = d", dn.getName() );
     }
 
 
@@ -134,7 +134,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a=b+c=d, e=f + g=h + i=j" );
         assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.toString() );
-        assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getUpName() );
+        assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() );
     }
 
 
@@ -147,7 +147,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "OID.12.34.56 = azerty" );
         assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        assertEquals( "OID.12.34.56 = azerty", dn.getUpName() );
+        assertEquals( "OID.12.34.56 = azerty", dn.getName() );
     }
 
 
@@ -160,7 +160,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "oid.12.34.56 = azerty" );
         assertEquals( "oid.12.34.56=azerty", dn.toString() );
-        assertEquals( "oid.12.34.56 = azerty", dn.getUpName() );
+        assertEquals( "oid.12.34.56 = azerty", dn.getName() );
     }
 
 
@@ -174,7 +174,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "12.34.56 = azerty" );
         assertEquals( "12.34.56=azerty", dn.toString() );
-        assertEquals( "12.34.56 = azerty", dn.getUpName() );
+        assertEquals( "12.34.56 = azerty", dn.getName() );
     }
 
 
@@ -188,7 +188,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "12.34.56 = azerty; 7.8 = test" );
         assertEquals( "12.34.56=azerty,7.8=test", dn.toString() );
-        assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getUpName() );
+        assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() );
     }
 
 
@@ -201,11 +201,11 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C3\\A9" );
         assertEquals( "a=\\,=\\+\\<\\>#\\;\\\\\\\"\u00e9", dn.toString() );
-        assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C3\\A9", dn.getUpName() );
+        assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\C3\\A9", dn.getName() );
 
         dn = ( LdapDN ) dnParser.parse( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\u00e9" );
         assertEquals( "a=\\,=\\+\\<\\>#\\;\\\\\\\"\u00e9", dn.toString() );
-        assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\u00e9", dn.getUpName() );
+        assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\u00e9", dn.getName() );
     }
 
 
@@ -218,7 +218,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = #0010A0AAFF" );
         assertEquals( "a=#0010A0AAFF", dn.toString() );
-        assertEquals( "a = #0010A0AAFF", dn.getUpName() );
+        assertEquals( "a = #0010A0AAFF", dn.getName() );
     }
 
 
@@ -254,11 +254,11 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = quoted \\\"value" );
         assertEquals( "a=quoted \\\"value", dn.toString() );
-        assertEquals( "a = quoted \\\"value", dn.getUpName() );
+        assertEquals( "a = quoted \\\"value", dn.getName() );
         
         dn = ( LdapDN ) dnParser.parse( "cn=Mackie \\\"The Knife\\\" Messer" );
         assertEquals( "cn=Mackie \\\"The Knife\\\" Messer", dn.toString() );
-        assertEquals( "cn=Mackie \\\"The Knife\\\" Messer", dn.getUpName() );
+        assertEquals( "cn=Mackie \\\"The Knife\\\" Messer", dn.getName() );
     }
 
 
@@ -271,7 +271,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN dn = ( LdapDN ) dnParser.parse( "a = AC\\\\DC" );
         assertEquals( "a=AC\\\\DC", dn.toString() );
-        assertEquals( "a = AC\\\\DC", dn.getUpName() );
+        assertEquals( "a = AC\\\\DC", dn.getName() );
     }
 
 
@@ -301,7 +301,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN name = ( LdapDN ) dnParser.parse( dn );
 
-        assertEquals( dn, name.getUpName() );
+        assertEquals( dn, name.getName() );
         assertEquals( "cn=Emmanuel  L\u00e9charny", name.toString() );
     }
 
@@ -315,7 +315,7 @@
         NameParser dnParser = LdapDnParser.getNameParser();
         LdapDN name = ( LdapDN ) dnParser.parse( dn );
 
-        assertEquals( dn, name.getUpName() );
+        assertEquals( dn, name.getName() );
         assertEquals( "c=E\u00e9c", name.toString() );
     }
 
@@ -329,7 +329,7 @@
 
         assertEquals(
             "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US", name
-                .getUpName() );
+                .getName() );
         assertEquals(
             "cn=Billy Bakers,oid.2.5.4.11=Corporate Tax,ou=Fin-Accounting,ou=Americas,ou=Search,o=IMC,c=US", name
                 .toString() );
@@ -400,7 +400,7 @@
 
         assertEquals( "RFC1779_1 : ",
             "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US",
-            ( ( LdapDN ) nameRFC1779_1 ).getUpName() );
+            ( ( LdapDN ) nameRFC1779_1 ).getName() );
         assertEquals( "RFC1779_1 : ", "cn=Marshall T. Rose,o=Dover Beach Consulting,l=Santa Clara,st=California,c=US",
             nameRFC1779_1.toString() );
     }
@@ -418,7 +418,7 @@
 
         Name nameRFC2253_1 = parser.parse( "CN=Steve Kille,O=Isode limited,C=GB" );
 
-        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( ( LdapDN ) nameRFC2253_1 ).getUpName() );
+        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( ( LdapDN ) nameRFC2253_1 ).getName() );
     }
 
 
@@ -435,7 +435,7 @@
         Name nameRFC2253_2 = parser.parse( "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US" );
 
         assertEquals( "RFC2253_2 : ", "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US",
-            ( ( LdapDN ) nameRFC2253_2 ).getUpName() );
+            ( ( LdapDN ) nameRFC2253_2 ).getName() );
         assertEquals( "RFC2253_2 : ", "cn=J. Smith+cn=Sales,o=Widget Inc.,c=US", nameRFC2253_2.toString() );
     }
 
@@ -453,7 +453,7 @@
         Name nameRFC2253_3 = parser.parse( "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB" );
 
         assertEquals( "RFC2253_3 : ", "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB", ( ( LdapDN ) nameRFC2253_3 )
-            .getUpName() );
+            .getName() );
         assertEquals( "RFC2253_3 : ", "cn=L. Eagle,o=Sue\\, Grabbit and Runn,c=GB", nameRFC2253_3.toString() );
     }
 
@@ -469,7 +469,7 @@
         NameParser parser = LdapDnParser.getNameParser();
 
         Name nameRFC2253_4 = parser.parse( "CN=Before\\0DAfter,O=Test,C=GB" );
-        assertEquals( "RFC2253_4 : ", "CN=Before\\0DAfter,O=Test,C=GB", ( ( LdapDN ) nameRFC2253_4 ).getUpName() );
+        assertEquals( "RFC2253_4 : ", "CN=Before\\0DAfter,O=Test,C=GB", ( ( LdapDN ) nameRFC2253_4 ).getName() );
     }
 
 
@@ -486,7 +486,7 @@
         Name nameRFC2253_5 = parser.parse( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );
 
         assertEquals( "RFC2253_5 : ", "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB", ( ( LdapDN ) nameRFC2253_5 )
-            .getUpName() );
+            .getName() );
     }
 
 
@@ -502,7 +502,7 @@
 
         Name nameRFC2253_6 = parser.parse( "SN=Lu\\C4\\8Di\\C4\\87" );
 
-        assertEquals( "RFC2253_6 : ", "SN=Lu\\C4\\8Di\\C4\\87", ( ( LdapDN ) nameRFC2253_6 ).getUpName() );
+        assertEquals( "RFC2253_6 : ", "SN=Lu\\C4\\8Di\\C4\\87", ( ( LdapDN ) nameRFC2253_6 ).getName() );
     }
 
 
@@ -553,7 +553,7 @@
         String path = "windowsFilePath=C:\\\\cygwin";
         NameParser parser = LdapDnParser.getNameParser();
         Name result = parser.parse( path );
-        assertEquals( path, ( ( LdapDN ) result ).getUpName() );
+        assertEquals( path, ( ( LdapDN ) result ).getName() );
         assertEquals( "windowsfilepath=C:\\\\cygwin", result.toString() );
     }
 



Mime
View raw message