directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r321352 - /directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
Date Sat, 15 Oct 2005 15:36:24 GMT
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() );
+    }
 }



Mime
View raw message