directory-commits mailing list archives

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



Mime
View raw message