harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r766051 - /harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/extras/TestRdnParser.java
Date Fri, 17 Apr 2009 15:31:24 GMT
Author: odeakin
Date: Fri Apr 17 15:31:23 2009
New Revision: 766051

URL: http://svn.apache.org/viewvc?rev=766051&view=rev
Log:
Make sure bytes are UTF-8 encoded when comparing.

Modified:
    harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/extras/TestRdnParser.java

Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/extras/TestRdnParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/extras/TestRdnParser.java?rev=766051&r1=766050&r2=766051&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/extras/TestRdnParser.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/extras/TestRdnParser.java
Fri Apr 17 15:31:23 2009
@@ -918,13 +918,13 @@
 	 * <p>Test method to test if the null character in utf8 where is put when the types
are not equals between them.</p>
 	 *
 	 */
-	public void testRDNNULL() {
+	public void testRDNNULL() throws Exception {
 		try {
 			String y="ca=nine+type="+Rdn.escapeValue("\\00");
 			Rdn x=new Rdn("ca=nine+type=\"liom,\"+type=\"\\00\"");
 			byte[] temp=new byte[]{99,97,61,110,105,110,101,43,116,121,112,101,61,0,43,116,121,112,101,61,108,105,111,109,92,44};
 			for(int i=0;i<26;i++){
-				assertEquals(temp[i],x.toString().getBytes()[i]);
+				assertEquals(temp[i],x.toString().getBytes("UTF-8")[i]);
 			}
 			
 			x=new Rdn("ca=nine+pe=\"liom,\"+type=\"\\00\"");



Mime
View raw message