You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/10/15 17:36:46 UTC

svn commit: r321353 - /directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java

Author: elecharny
Date: Sat Oct 15 08:36:42 2005
New Revision: 321353

URL: http://svn.apache.org/viewcvs?rev=321353&view=rev
Log:
Added three tests to check that LdapName work ok with french, german an turk characters

Modified:
    directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java

Modified: directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java?rev=321353&r1=321352&r2=321353&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java (original)
+++ directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java Sat Oct 15 08:36:42 2005
@@ -262,4 +262,42 @@
         String result = parser.parse( input ).toString();
         assertEquals( input, result );
     }
+    
+    
+    public void testNameFrenchChars() throws Exception
+    {
+        String cn = new String(
+                new byte[] { 'c', 'n', '=', 0x4A, (byte) 0xC3, (byte) 0xA9, 0x72, (byte) 0xC3, (byte) 0xB4, 0x6D, 0x65 });
+
+        DnParser parser = new DnParser();
+        String result = parser.parse( cn ).toString();
+        
+        assertEquals( "cn=Jérôme", result );
+    }
+
+    public void testNameGermanChars() throws Exception
+    {
+        String cn = new String(new byte[]{'c', 'n', '=', (byte)0xC3, (byte)0x84, (byte)0xC3, (byte)0x96, (byte)0xC3, 
+                    (byte)0x9C, (byte)0xC3, (byte)0x9F, (byte)0xC3, (byte)0xA4, (byte)0xC3, (byte)0xB6, (byte)0xC3, (byte)0xBC}, "UTF-8");
+        
+
+        DnParser parser = new DnParser();
+        String result = parser.parse( cn ).toString();
+        
+        assertEquals( "cn=ÄÖÜßäöü", result );
+    }
+
+    public void testNameTurkishChars() throws Exception
+    {
+        String cn = new String(new byte[]{'c', 'n', '=', (byte)0xC4, (byte)0xB0, (byte)0xC4, (byte)0xB1, 
+                (byte)0xC5, (byte)0x9E, (byte)0xC5, (byte)0x9F, 
+                (byte)0xC3, (byte)0x96, (byte)0xC3, (byte)0xB6, 
+                (byte)0xC3, (byte)0x9C, (byte)0xC3, (byte)0xBC, 
+                (byte)0xC4, (byte)0x9E, (byte)0xC4, (byte)0x9F }, "UTF-8");
+
+        DnParser parser = new DnParser();
+        String result = parser.parse( cn ).toString();
+        
+        assertEquals( "cn=İıŞşÖöÜüĞğ", result );
+    }
 }  // end class DnParserTest