geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r422046 - /geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java
Date Fri, 14 Jul 2006 21:04:23 GMT
Author: rickmcguire
Date: Fri Jul 14 14:04:22 2006
New Revision: 422046

URL: http://svn.apache.org/viewvc?rev=422046&view=rev
Log:
GERONIMO-2193 Build test failure in MimeUtilityTest on the Mac



Modified:
    geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java

Modified: geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java?rev=422046&r1=422045&r2=422046&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java
(original)
+++ geronimo/specs/trunk/geronimo-spec-javamail-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java
Fri Jul 14 14:04:22 2006
@@ -33,6 +33,8 @@
 
 public class MimeUtilityTest extends TestCase {
 
+    private byte[] encodeBytes = new byte[] { 32, 104, -61, -87, 33, 32, -61, -96, -61, -88,
-61, -76, 117, 32, 33, 33, 33 };
+
     public void testEncodeDecode() throws Exception {
 
         byte [] data = new byte[256];
@@ -107,31 +109,35 @@
 
     public void testEncodeWord() throws Exception {
         assertEquals("abc", MimeUtility.encodeWord("abc"));
+
+        String encodeString = new String(encodeBytes, "UTF-8");
         // default code page dependent, hard to directly test the encoded results
-        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord(MimeUtility.encodeWord("
hé! àèôu !!!")));
+        assertEquals(encodeString, MimeUtility.decodeWord(MimeUtility.encodeWord(encodeString)));
 
-        String encoded = MimeUtility.encodeWord(" hé! àèôu !!!", "UTF-8", "Q");
+        String encoded = MimeUtility.encodeWord(encodeString, "UTF-8", "Q");
         assertEquals("=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=", encoded);
-        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord(encoded));
+        assertEquals(encodeString, MimeUtility.decodeWord(encoded));
 
-        encoded = MimeUtility.encodeWord(" hé! àèôu !!!", "UTF-8", "B");
+        encoded = MimeUtility.encodeWord(encodeString, "UTF-8", "B");
         assertEquals("=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=", encoded);
-        assertEquals(" hé! àèôu !!!", MimeUtility.decodeWord(encoded));
+        assertEquals(encodeString, MimeUtility.decodeWord(encoded));
     }
 
 
     public void testEncodeText() throws Exception {
         assertEquals("abc", MimeUtility.encodeWord("abc"));
+
+        String encodeString = new String(encodeBytes, "UTF-8");
         // default code page dependent, hard to directly test the encoded results
-        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText(MimeUtility.encodeText("
hé! àèôu !!!")));
+        assertEquals(encodeString, MimeUtility.decodeText(MimeUtility.encodeText(encodeString)));
 
-        String encoded = MimeUtility.encodeText(" hé! àèôu !!!", "UTF-8", "Q");
+        String encoded = MimeUtility.encodeText(encodeString, "UTF-8", "Q");
         assertEquals("=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=", encoded);
-        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText(encoded));
+        assertEquals(encodeString, MimeUtility.decodeText(encoded));
 
-        encoded = MimeUtility.encodeText(" hé! àèôu !!!", "UTF-8", "B");
+        encoded = MimeUtility.encodeText(encodeString, "UTF-8", "B");
         assertEquals("=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=", encoded);
-        assertEquals(" hé! àèôu !!!", MimeUtility.decodeText(encoded));
+        assertEquals(encodeString, MimeUtility.decodeText(encoded));
     }
 
 



Mime
View raw message