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:24 UTC

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

Author: elecharny
Date: Sat Oct 15 08:36:20 2005
New Revision: 321352

URL: http://svn.apache.org/viewcvs?rev=321352&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/LdapNameTest.java

Modified: directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java?rev=321352&r1=321351&r2=321352&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java (original)
+++ directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java Sat Oct 15 08:36:20 2005
@@ -1034,4 +1034,38 @@
 
         assertEquals( -15, name1.compareTo( name2 ) );
     }
+    
+    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 });
+
+        Name name = new LdapName( cn);
+        
+        assertEquals( "cn=Jérôme", name.toString() );
+    }
+
+    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");
+        
+
+        Name name = new LdapName( cn );
+        
+        assertEquals( "cn=ÄÖÜßäöü", name.toString() );
+    }
+
+    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");
+
+        Name name = new LdapName( cn);
+        
+        assertEquals( "cn=İıŞşÖöÜüĞğ", name.toString() );
+    }
 }