james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ieu...@apache.org
Subject svn commit: r1426193 [1/7] - in /james/mime4j/trunk: ./ core/src/test/java/org/apache/james/mime4j/ core/src/test/java/org/apache/james/mime4j/codec/ core/src/test/java/org/apache/james/mime4j/io/ core/src/test/java/org/apache/james/mime4j/parser/ core...
Date Thu, 27 Dec 2012 13:23:56 GMT
Author: ieugen
Date: Thu Dec 27 13:23:54 2012
New Revision: 1426193

URL: http://svn.apache.org/viewvc?rev=1426193&view=rev
Log:
MIME4J-221 Updated most tests to junit-4 style

Added:
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/ByteArrayBufferTest.java
      - copied, changed from r1426178, james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java
Removed:
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java
Modified:
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/ExampleMail.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeExceptionTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeIOExceptionTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/TestUtil.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64OutputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/CodecUtilTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/EncoderUtilTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableEncodeTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableOutputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableTextEncodeTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/BufferedLineReaderInputStreamBufferTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/BufferedLineReaderInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/EOLConvertingInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/LimitedInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/LineNumberInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/LineReaderInputStreamAdaptorTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/MimeBoundaryInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/io/PositionInputStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserExampleMessagesTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenEmbeddedMessageTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenNoRecurseTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamBodyDescriptorTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamReaderTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartTokensTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/CharsetUtilTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/MimeUtilTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/ExampleMessagesRoundtripTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/HeaderTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageCompleteMailTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageHeadlessParserTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageServiceFactoryTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageWriteToTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MimeBuilderCopyTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MultipartFormTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/ContentTypeFieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/LenientContentDispositionFieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/LenientContentLanguageFieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/LenientContentLocationFieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/LenientContentTypeFieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/LenientDateTimeFieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/LenientMimeVersionParserTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/MimeVersionParserTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/AddressTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressBuilderTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressFormatterTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/contentdisposition/ContentDispositionTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/contenttype/ContentTypeTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/datetime/DateTimeTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/mimeversion/MimeVersionParserTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/structured/StructuredFieldParserTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/MaximalBodyDescriptorTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/message/StringInputStreamTest.java
    james/mime4j/trunk/pom.xml
    james/mime4j/trunk/storage/src/test/java/org/apache/james/mime4j/storage/DefaultStorageProviderTest.java
    james/mime4j/trunk/storage/src/test/java/org/apache/james/mime4j/storage/MultiReferenceStorageTest.java
    james/mime4j/trunk/storage/src/test/java/org/apache/james/mime4j/storage/SingleBodyCopyTest.java
    james/mime4j/trunk/storage/src/test/java/org/apache/james/mime4j/storage/StorageProviderTest.java

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/ExampleMail.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/ExampleMail.java?rev=1426193&r1=1426192&r2=1426193&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/ExampleMail.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/ExampleMail.java Thu Dec 27 13:23:54 2012
@@ -19,11 +19,11 @@
 
 package org.apache.james.mime4j;
 
+import org.apache.james.mime4j.util.CharsetUtil;
+
 import java.nio.charset.Charset;
 import java.util.Locale;
 
-import org.apache.james.mime4j.util.CharsetUtil;
-
 public class ExampleMail {
 
     public static final String MIME_MULTIPART_EMBEDDED_MESSAGES_INNER_MULTIPART_MIXED = "--4.66920160910299\r\n" +
@@ -123,211 +123,211 @@ public class ExampleMail {
     public static final Charset LATIN1 = CharsetUtil.ISO_8859_1;
 
     public static final String MIME_MULTIPART_EMBEDDED_MESSAGES =
-        "From: Timothy Tayler <timothy@example.org>\r\n" +
-        "To: Samual Smith <samual@example.org>\r\n" +
-        "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
-        "Subject: A Multipart Email\r\n" +
-        "Content-Type: multipart/mixed;boundary=1729\r\n" +
-        "\r\n" +
-        MIME_MULTIPART_EMBEDDED_MESSAGES_BODY;
+            "From: Timothy Tayler <timothy@example.org>\r\n" +
+                    "To: Samual Smith <samual@example.org>\r\n" +
+                    "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
+                    "Subject: A Multipart Email\r\n" +
+                    "Content-Type: multipart/mixed;boundary=1729\r\n" +
+                    "\r\n" +
+                    MIME_MULTIPART_EMBEDDED_MESSAGES_BODY;
 
 
     public static final String MULTIPART_WITH_CONTENT_LOCATION =
-        "From: Timothy Tayler <timothy@example.org>\r\n" +
-        "To: Samual Smith <samual@example.org>\r\n" +
-        "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
-        "Subject: A Multipart Email With Content-Location\r\n" +
-        "Content-Type: multipart/mixed;boundary=1729\r\n\r\n" +
-        "Start with a preamble\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: application/xhtml+xml\r\n" +
-        "Content-Location: relative/url\r\n\r\n" +
-        "<!DOCTYPE html\r\n" +
-        "PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n" +
-        "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n" +
-        "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: text/plain; charset=US-ASCII\r\n" +
-        "Content-Location: http://www.example.org/absolute/rhubard.txt\r\n\r\n" +
-        "Rhubarb!\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: text/html; charset=US-ASCII\r\n\r\n" +
-        "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: text/plain; charset=US-ASCII\r\n" +
-        "Content-Location: (Some comment) \"http://www.example.org/absolute/comments/rhubard.txt\"(Another comment)\r\n\r\n" +
-        "Rhubarb!\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: text/html; charset=US-ASCII\r\n" +
-        "Content-Location:\"http://www.example.org/this/\r\n" +
-        "          is/a/very/long/url/split/\r\n" +
-        "          over/two/lines/\"\r\n\r\n" +
-        "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
-        "\r\n--1729--\r\n" +
-        "This is the epilogue\r\n";
+            "From: Timothy Tayler <timothy@example.org>\r\n" +
+                    "To: Samual Smith <samual@example.org>\r\n" +
+                    "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
+                    "Subject: A Multipart Email With Content-Location\r\n" +
+                    "Content-Type: multipart/mixed;boundary=1729\r\n\r\n" +
+                    "Start with a preamble\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: application/xhtml+xml\r\n" +
+                    "Content-Location: relative/url\r\n\r\n" +
+                    "<!DOCTYPE html\r\n" +
+                    "PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n" +
+                    "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n" +
+                    "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: text/plain; charset=US-ASCII\r\n" +
+                    "Content-Location: http://www.example.org/absolute/rhubard.txt\r\n\r\n" +
+                    "Rhubarb!\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: text/html; charset=US-ASCII\r\n\r\n" +
+                    "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: text/plain; charset=US-ASCII\r\n" +
+                    "Content-Location: (Some comment) \"http://www.example.org/absolute/comments/rhubard.txt\"(Another comment)\r\n\r\n" +
+                    "Rhubarb!\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: text/html; charset=US-ASCII\r\n" +
+                    "Content-Location:\"http://www.example.org/this/\r\n" +
+                    "          is/a/very/long/url/split/\r\n" +
+                    "          over/two/lines/\"\r\n\r\n" +
+                    "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
+                    "\r\n--1729--\r\n" +
+                    "This is the epilogue\r\n";
 
     public static final String MULTIPART_WITH_BINARY_ATTACHMENTS_HEADER =
-        "Return-Path: <robertburrelldonkin@blueyonder.co.uk>\r\n" +
-        "Received: (qmail 18554 invoked from network); 25 May 2008 14:38:53 -0000\r\n" +
-        "Received: from unknown (HELO p3presmtp01-16.prod.phx3.secureserver.net)\r\n" +
-        "        ([208.109.80.165]) (envelope-sender <rdonkin-owner@locus.apache.org>) by\r\n" +
-        "        smtp20-01.prod.mesa1.secureserver.net (qmail-1.03) with SMTP for\r\n" +
-        "        <asf@xmlmapt.org>; 25 May 2008 14:38:53 -0000\r\n" +
-        "Received: (qmail 9751 invoked from network); 25 May 2008 14:38:53 -0000\r\n" +
-        "Received: from minotaur.apache.org ([140.211.11.9]) (envelope-sender\r\n" +
-        "        <rdonkin-owner@locus.apache.org>) by\r\n" +
-        "        p3presmtp01-16.prod.phx3.secureserver.net (qmail-ldap-1.03) with SMTP for\r\n" +
-        "        <asf@xmlmapt.org>; 25 May 2008 14:38:50 -0000\r\n" +
-        "Received: (qmail 46768 invoked by uid 1289); 25 May 2008 14:38:46 -0000\r\n" +
-        "Delivered-To: rdonkin@locus.apache.org\r\n" +
-        "Received: (qmail 46763 invoked from network); 25 May 2008 14:38:46 -0000\r\n" +
-        "Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by\r\n" +
-        "        minotaur.apache.org with SMTP; 25 May 2008 14:38:46 -0000\r\n" +
-        "Received: (qmail 61275 invoked by uid 500); 25 May 2008 14:38:48 -0000\r\n" +
-        "Delivered-To: apmail-rdonkin@apache.org\r\n" +
-        "Delivered-To: rob@localhost\r\n" +
-        "Delivered-To: rob@localhost\r\n" +
-        "Received: (qmail 61272 invoked by uid 99); 25 May 2008 14:38:48 -0000\r\n" +
-        "Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)\r\n" +
-        "        by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008 07:38:48 -0700\r\n" +
-        "X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS\r\n" +
-        "X-Spam-Check-By: apache.org\r\n" +
-        "Received-SPF: pass (athena.apache.org: domain of\r\n" +
-        "        robertburrelldonkin@blueyonder.co.uk designates 195.188.213.5 as permitted\r\n" +
-        "        sender)\r\n" +
-        "Received: from [195.188.213.5] (HELO smtp-out2.blueyonder.co.uk)\r\n" +
-        "        (195.188.213.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008\r\n" +
-        "        14:38:00 +0000\r\n" +
-        "Received: from [172.23.170.140] (helo=anti-virus02-07) by\r\n" +
-        "        smtp-out2.blueyonder.co.uk with smtp (Exim 4.52) id 1K0HMV-00087e-HY for\r\n" +
-        "        rdonkin@apache.org; Sun, 25 May 2008 15:38:15 +0100\r\n" +
-        "Received: from [82.38.65.6] (helo=[10.0.0.27]) by\r\n" +
-        "        asmtp-out5.blueyonder.co.uk with esmtpa (Exim 4.52) id 1K0HMU-0001A2-3q for\r\n" +
-        "        rdonkin@apache.org; Sun, 25 May 2008 15:38:14 +0100\r\n" +
-        "Subject: This is an example of a multipart mixed email with image content\r\n" +
-        "From: Robert Burrell Donkin <robertburrelldonkin@blueyonder.co.uk>\r\n" +
-        "To: Robert Burrell Donkin <rdonkin@apache.org>\r\n" +
-        "Content-Type: multipart/mixed; boundary=\"=-tIdGYVstQJghyEDATnJ+\"\r\n" +
-        "Date: Sun, 25 May 2008 15:38:13 +0100\r\n" +
-        "Message-Id: <1211726293.5772.10.camel@localhost>\r\n" +
-        "Mime-Version: 1.0\r\n" +
-        "X-Mailer: Evolution 2.12.3 \r\n" +
-        "X-Virus-Checked: Checked by ClamAV on apache.org\r\n" +
-        "X-Nonspam: None\r\n" +
-        "X-fetched-from: mail.xmlmapt.org\r\n" +
-        "X-Evolution-Source: imap://rob@thebes/\r\n" +
-        "\r\n";
+            "Return-Path: <robertburrelldonkin@blueyonder.co.uk>\r\n" +
+                    "Received: (qmail 18554 invoked from network); 25 May 2008 14:38:53 -0000\r\n" +
+                    "Received: from unknown (HELO p3presmtp01-16.prod.phx3.secureserver.net)\r\n" +
+                    "        ([208.109.80.165]) (envelope-sender <rdonkin-owner@locus.apache.org>) by\r\n" +
+                    "        smtp20-01.prod.mesa1.secureserver.net (qmail-1.03) with SMTP for\r\n" +
+                    "        <asf@xmlmapt.org>; 25 May 2008 14:38:53 -0000\r\n" +
+                    "Received: (qmail 9751 invoked from network); 25 May 2008 14:38:53 -0000\r\n" +
+                    "Received: from minotaur.apache.org ([140.211.11.9]) (envelope-sender\r\n" +
+                    "        <rdonkin-owner@locus.apache.org>) by\r\n" +
+                    "        p3presmtp01-16.prod.phx3.secureserver.net (qmail-ldap-1.03) with SMTP for\r\n" +
+                    "        <asf@xmlmapt.org>; 25 May 2008 14:38:50 -0000\r\n" +
+                    "Received: (qmail 46768 invoked by uid 1289); 25 May 2008 14:38:46 -0000\r\n" +
+                    "Delivered-To: rdonkin@locus.apache.org\r\n" +
+                    "Received: (qmail 46763 invoked from network); 25 May 2008 14:38:46 -0000\r\n" +
+                    "Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by\r\n" +
+                    "        minotaur.apache.org with SMTP; 25 May 2008 14:38:46 -0000\r\n" +
+                    "Received: (qmail 61275 invoked by uid 500); 25 May 2008 14:38:48 -0000\r\n" +
+                    "Delivered-To: apmail-rdonkin@apache.org\r\n" +
+                    "Delivered-To: rob@localhost\r\n" +
+                    "Delivered-To: rob@localhost\r\n" +
+                    "Received: (qmail 61272 invoked by uid 99); 25 May 2008 14:38:48 -0000\r\n" +
+                    "Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)\r\n" +
+                    "        by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008 07:38:48 -0700\r\n" +
+                    "X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS\r\n" +
+                    "X-Spam-Check-By: apache.org\r\n" +
+                    "Received-SPF: pass (athena.apache.org: domain of\r\n" +
+                    "        robertburrelldonkin@blueyonder.co.uk designates 195.188.213.5 as permitted\r\n" +
+                    "        sender)\r\n" +
+                    "Received: from [195.188.213.5] (HELO smtp-out2.blueyonder.co.uk)\r\n" +
+                    "        (195.188.213.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008\r\n" +
+                    "        14:38:00 +0000\r\n" +
+                    "Received: from [172.23.170.140] (helo=anti-virus02-07) by\r\n" +
+                    "        smtp-out2.blueyonder.co.uk with smtp (Exim 4.52) id 1K0HMV-00087e-HY for\r\n" +
+                    "        rdonkin@apache.org; Sun, 25 May 2008 15:38:15 +0100\r\n" +
+                    "Received: from [82.38.65.6] (helo=[10.0.0.27]) by\r\n" +
+                    "        asmtp-out5.blueyonder.co.uk with esmtpa (Exim 4.52) id 1K0HMU-0001A2-3q for\r\n" +
+                    "        rdonkin@apache.org; Sun, 25 May 2008 15:38:14 +0100\r\n" +
+                    "Subject: This is an example of a multipart mixed email with image content\r\n" +
+                    "From: Robert Burrell Donkin <robertburrelldonkin@blueyonder.co.uk>\r\n" +
+                    "To: Robert Burrell Donkin <rdonkin@apache.org>\r\n" +
+                    "Content-Type: multipart/mixed; boundary=\"=-tIdGYVstQJghyEDATnJ+\"\r\n" +
+                    "Date: Sun, 25 May 2008 15:38:13 +0100\r\n" +
+                    "Message-Id: <1211726293.5772.10.camel@localhost>\r\n" +
+                    "Mime-Version: 1.0\r\n" +
+                    "X-Mailer: Evolution 2.12.3 \r\n" +
+                    "X-Virus-Checked: Checked by ClamAV on apache.org\r\n" +
+                    "X-Nonspam: None\r\n" +
+                    "X-fetched-from: mail.xmlmapt.org\r\n" +
+                    "X-Evolution-Source: imap://rob@thebes/\r\n" +
+                    "\r\n";
 
     public static final String MULTIPART_WITH_BINARY_ATTACHMENTS_BODY = "--=-tIdGYVstQJghyEDATnJ+\r\n" +
-        "Content-Type: text/plain\r\n" +
-        "Content-Transfer-Encoding: 7bit\r\n" +
-        "\r\n" +
-        "Licensed to the Apache Software Foundation (ASF) under one\r\n" +
-        "or more contributor license agreements.  See the NOTICE file\r\n" +
-        "distributed with this work for additional information\r\n" +
-        "regarding copyright ownership.  The ASF licenses this file\r\n" +
-        "to you under the Apache License, Version 2.0 (the\r\n" +
-        "\"License\"); you may not use this file except in compliance\r\n" +
-        "with the License.  You may obtain a copy of the License at\r\n" +
-        "\r\n" +
-        "    http://www.apache.org/licenses/LICENSE-2.0\r\n" +
-        " \r\n" +
-        "Unless required by applicable law or agreed to in writing,\r\n" +
-        "software distributed under the License is distributed on an\r\n" +
-        "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n" +
-        "KIND, either express or implied.  See the License for the\r\n" +
-        "specific language governing permissions and limitations\r\n" +
-        "under the License.\r\n" +
-        " \r\n" +
-        "\r\n" +
-        "--=-tIdGYVstQJghyEDATnJ+\r\n" +
-        "Content-Disposition: attachment; filename=blob.png;\r\n   modification-date=\"Sun, 21 Jun 2008 15:32:18 +0000\"; " +
-        "creation-date=\"Sat, 20 Jun 2008 10:15:09 +0000\"; read-date=\"Mon, 22 Jun 2008 12:08:56 +0000\";size=10234;\r\n" +
-        "Content-Type: image/png; name=blob.png\r\n" +
-        "Content-Transfer-Encoding: base64\r\n" +
-        "\r\n" +
-        "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAL\r\n" +
-        "EwAACxMBAJqcGAAAAAd0SU1FB9gFGQ4iJ99ufcYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRo\r\n" +
-        "IEdJTVBXgQ4XAAAA0ElEQVQY02XMwUrDQBhF4XsnkyYhjWJaCloEN77/a/gERVwJLQiiNjYmbTqZ\r\n" +
-        "/7qIG/VsPziMTw+23Wj/ovZdMQJgViCvWNVusfa23djuUf2nugbnI2RynkWF5a2Fwdvrs7q9vhqE\r\n" +
-        "E2QAEIO6BhZBerUf6luMw49NyTR0OLw5kJD9sqk4Ipwc6GAREv5n5piXTDOQfy1JMSs8ZgXKq2kF\r\n" +
-        "iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp\r\n" +
-        "rQAAAABJRU5ErkJggg==\r\n" +
-        "\r\n" +
-        "--=-tIdGYVstQJghyEDATnJ+\r\n" +
-        "Content-Disposition: attachment; filename=blob.png\r\n" +
-        "Content-Type: image/png; name=blob.png\r\n" +
-        "Content-Transfer-Encoding: base64\r\n" +
-        "\r\n" +
-        "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAL\r\n" +
-        "EwAACxMBAJqcGAAAAAd0SU1FB9gFGQ4iJ99ufcYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRo\r\n" +
-        "IEdJTVBXgQ4XAAAA0ElEQVQY02XMwUrDQBhF4XsnkyYhjWJaCloEN77/a/gERVwJLQiiNjYmbTqZ\r\n" +
-        "/7qIG/VsPziMTw+23Wj/ovZdMQJgViCvWNVusfa23djuUf2nugbnI2RynkWF5a2Fwdvrs7q9vhqE\r\n" +
-        "E2QAEIO6BhZBerUf6luMw49NyTR0OLw5kJD9sqk4Ipwc6GAREv5n5piXTDOQfy1JMSs8ZgXKq2kF\r\n" +
-        "iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp\r\n" +
-        "rQAAAABJRU5ErkJggg==\r\n" +
-        "\r\n" +
-        "--=-tIdGYVstQJghyEDATnJ+\r\n" +
-        "Content-Disposition: attachment; filename=rhubarb.txt\r\n" +
-        "Content-Type: text/plain; name=rhubarb.txt; charset=us-ascii\r\n" +
-        "Content-Language: en, en-US, en-CA\r\n" +
-        "Content-Transfer-Encoding: quoted-printable\r\n" +
-        "\r\n" +
-        "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
-        "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
-        "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
-        "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
-        "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
-        " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
-        "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
-        "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
-        "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
-        "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
-        "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
-        "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
-        "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
-        " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
-        "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
-        "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
-        "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
-        "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
-        "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
-        "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
-        "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
-        " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
-        "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
-        "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
-        "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
-        "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
-        "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
-        "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
-        "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
-        " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
-        "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
-        "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
-        "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
-        "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
-        "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
-        "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
-        "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
-        " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
-        "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
-        "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
-        "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb\r\n" +
-        "\r\n" +
-        "--=-tIdGYVstQJghyEDATnJ+--\r\n";
+            "Content-Type: text/plain\r\n" +
+            "Content-Transfer-Encoding: 7bit\r\n" +
+            "\r\n" +
+            "Licensed to the Apache Software Foundation (ASF) under one\r\n" +
+            "or more contributor license agreements.  See the NOTICE file\r\n" +
+            "distributed with this work for additional information\r\n" +
+            "regarding copyright ownership.  The ASF licenses this file\r\n" +
+            "to you under the Apache License, Version 2.0 (the\r\n" +
+            "\"License\"); you may not use this file except in compliance\r\n" +
+            "with the License.  You may obtain a copy of the License at\r\n" +
+            "\r\n" +
+            "    http://www.apache.org/licenses/LICENSE-2.0\r\n" +
+            " \r\n" +
+            "Unless required by applicable law or agreed to in writing,\r\n" +
+            "software distributed under the License is distributed on an\r\n" +
+            "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n" +
+            "KIND, either express or implied.  See the License for the\r\n" +
+            "specific language governing permissions and limitations\r\n" +
+            "under the License.\r\n" +
+            " \r\n" +
+            "\r\n" +
+            "--=-tIdGYVstQJghyEDATnJ+\r\n" +
+            "Content-Disposition: attachment; filename=blob.png;\r\n   modification-date=\"Sun, 21 Jun 2008 15:32:18 +0000\"; " +
+            "creation-date=\"Sat, 20 Jun 2008 10:15:09 +0000\"; read-date=\"Mon, 22 Jun 2008 12:08:56 +0000\";size=10234;\r\n" +
+            "Content-Type: image/png; name=blob.png\r\n" +
+            "Content-Transfer-Encoding: base64\r\n" +
+            "\r\n" +
+            "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAL\r\n" +
+            "EwAACxMBAJqcGAAAAAd0SU1FB9gFGQ4iJ99ufcYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRo\r\n" +
+            "IEdJTVBXgQ4XAAAA0ElEQVQY02XMwUrDQBhF4XsnkyYhjWJaCloEN77/a/gERVwJLQiiNjYmbTqZ\r\n" +
+            "/7qIG/VsPziMTw+23Wj/ovZdMQJgViCvWNVusfa23djuUf2nugbnI2RynkWF5a2Fwdvrs7q9vhqE\r\n" +
+            "E2QAEIO6BhZBerUf6luMw49NyTR0OLw5kJD9sqk4Ipwc6GAREv5n5piXTDOQfy1JMSs8ZgXKq2kF\r\n" +
+            "iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp\r\n" +
+            "rQAAAABJRU5ErkJggg==\r\n" +
+            "\r\n" +
+            "--=-tIdGYVstQJghyEDATnJ+\r\n" +
+            "Content-Disposition: attachment; filename=blob.png\r\n" +
+            "Content-Type: image/png; name=blob.png\r\n" +
+            "Content-Transfer-Encoding: base64\r\n" +
+            "\r\n" +
+            "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAL\r\n" +
+            "EwAACxMBAJqcGAAAAAd0SU1FB9gFGQ4iJ99ufcYAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRo\r\n" +
+            "IEdJTVBXgQ4XAAAA0ElEQVQY02XMwUrDQBhF4XsnkyYhjWJaCloEN77/a/gERVwJLQiiNjYmbTqZ\r\n" +
+            "/7qIG/VsPziMTw+23Wj/ovZdMQJgViCvWNVusfa23djuUf2nugbnI2RynkWF5a2Fwdvrs7q9vhqE\r\n" +
+            "E2QAEIO6BhZBerUf6luMw49NyTR0OLw5kJD9sqk4Ipwc6GAREv5n5piXTDOQfy1JMSs8ZgXKq2kF\r\n" +
+            "iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp\r\n" +
+            "rQAAAABJRU5ErkJggg==\r\n" +
+            "\r\n" +
+            "--=-tIdGYVstQJghyEDATnJ+\r\n" +
+            "Content-Disposition: attachment; filename=rhubarb.txt\r\n" +
+            "Content-Type: text/plain; name=rhubarb.txt; charset=us-ascii\r\n" +
+            "Content-Language: en, en-US, en-CA\r\n" +
+            "Content-Transfer-Encoding: quoted-printable\r\n" +
+            "\r\n" +
+            "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
+            "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
+            "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
+            "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
+            "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
+            " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
+            "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
+            "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
+            "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
+            "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
+            "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
+            "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
+            "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
+            " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
+            "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
+            "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
+            "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
+            "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
+            "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
+            "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
+            "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
+            " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
+            "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
+            "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
+            "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
+            "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
+            "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
+            "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
+            "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
+            " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
+            "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
+            "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
+            "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhu=\r\n" +
+            "barb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubar=\r\n" +
+            "b Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb R=\r\n" +
+            "hubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhub=\r\n" +
+            "arb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb=\r\n" +
+            " Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rh=\r\n" +
+            "ubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhuba=\r\n" +
+            "rb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb =\r\n" +
+            "Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb Rhubarb\r\n" +
+            "\r\n" +
+            "--=-tIdGYVstQJghyEDATnJ+--\r\n";
 
     public static final String MULTIPART_WITH_BINARY_ATTACHMENTS = MULTIPART_WITH_BINARY_ATTACHMENTS_HEADER +
-        "\r\n" + MULTIPART_WITH_BINARY_ATTACHMENTS_BODY;
+            "\r\n" + MULTIPART_WITH_BINARY_ATTACHMENTS_BODY;
 
     public static final String MULTIPART_WITH_BINARY_ATTACHMENTS_NOPREAMBLE = MULTIPART_WITH_BINARY_ATTACHMENTS_HEADER +
-        MULTIPART_WITH_BINARY_ATTACHMENTS_BODY;
+            MULTIPART_WITH_BINARY_ATTACHMENTS_BODY;
 
     public static final String MULTIPART_WITH_BINARY_ATTACHMENTS_PREAMBLE_EPILOGUE = MULTIPART_WITH_BINARY_ATTACHMENTS_HEADER +
-        "This is a preamble\r\n" +
-        "With 2 lines\r\n" + MULTIPART_WITH_BINARY_ATTACHMENTS_BODY +
-        "This is an epilogue\r\n" +
-        "With 2 lines\r\n";
+            "This is a preamble\r\n" +
+            "With 2 lines\r\n" + MULTIPART_WITH_BINARY_ATTACHMENTS_BODY +
+            "This is an epilogue\r\n" +
+            "With 2 lines\r\n";
 
     public static final String ONE_PART_MIME_ASCII_BODY = "A single part MIME mail.\r\n";
 
@@ -358,169 +358,169 @@ public class ExampleMail {
     public static final String ONE_PART_MIME_BASE64_ASCII_BODY = "Hello, World!\r\n";
 
     public static final String ONE_PART_MIME_WITH_CONTENT_DISPOSITION_PARAMETERS =
-        "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-        "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-        "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-        "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-        "Subject: [Mime4J] getReader\r\n" +
-        "MIME-Version: 1.0\r\n" +
-        "Content-Type: text/plain; charset=US-ASCII\r\n" +
-        "Content-Transfer-Encoding: 7bit\r\n" +
-        "Content-Disposition: inline; foo=bar; one=1; param=value;\r\n" +
-        "Content-MD5: " + MD5_CONTENT + "\r\n" +
-        "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-        "\r\n" +
-        ONE_PART_MIME_ASCII_BODY;
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+                    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+                    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+                    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+                    "Subject: [Mime4J] getReader\r\n" +
+                    "MIME-Version: 1.0\r\n" +
+                    "Content-Type: text/plain; charset=US-ASCII\r\n" +
+                    "Content-Transfer-Encoding: 7bit\r\n" +
+                    "Content-Disposition: inline; foo=bar; one=1; param=value;\r\n" +
+                    "Content-MD5: " + MD5_CONTENT + "\r\n" +
+                    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+                    "\r\n" +
+                    ONE_PART_MIME_ASCII_BODY;
 
     private static final byte[] ONE_PART_MIME_BASE64_ASCII_ENCODED = EncodeUtils.toBase64(ascii(ONE_PART_MIME_BASE64_ASCII_BODY));
 
     public static final String ONE_PART_MIME_ASCII = "Received: by 10.114.126.16 with HTTP; Thu, 6 Mar 2008 10:02:03 -0800 (PST)\r\n" +
-    "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-    "Subject: [Mime4J] getReader\r\n" +
-    "MIME-Version: 1.0\r\n" +
-    "Content-Type: text/plain; charset=US-ASCII\r\n" +
-    "Content-Transfer-Encoding: 7bit\r\n" +
-    "Content-Disposition: inline\r\n" +
-    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-    "\r\n" +
-    ONE_PART_MIME_ASCII_BODY;
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+            "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+            "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+            "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+            "Subject: [Mime4J] getReader\r\n" +
+            "MIME-Version: 1.0\r\n" +
+            "Content-Type: text/plain; charset=US-ASCII\r\n" +
+            "Content-Transfer-Encoding: 7bit\r\n" +
+            "Content-Disposition: inline\r\n" +
+            "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+            "\r\n" +
+            ONE_PART_MIME_ASCII_BODY;
 
     public static final String ONE_PART_MIME_ASCII_COMMENT_IN_MIME_VERSION = "Received: by 10.114.126.16 with HTTP; Thu, 6 Mar 2008 10:02:03 -0800 (PST)\r\n" +
-    "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-    "Subject: [Mime4J] getReader\r\n" +
-    "MIME-Version: 2.(This is a comment)4\r\n" +
-    "Content-Type: text/plain; charset=US-ASCII\r\n" +
-    "Content-Transfer-Encoding: 7bit\r\n" +
-    "Content-Disposition: inline\r\n" +
-    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-    "\r\n" + ONE_PART_MIME_ASCII_BODY;
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+            "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+            "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+            "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+            "Subject: [Mime4J] getReader\r\n" +
+            "MIME-Version: 2.(This is a comment)4\r\n" +
+            "Content-Type: text/plain; charset=US-ASCII\r\n" +
+            "Content-Transfer-Encoding: 7bit\r\n" +
+            "Content-Disposition: inline\r\n" +
+            "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+            "\r\n" + ONE_PART_MIME_ASCII_BODY;
 
     public static final String ONE_PART_MIME_ASCII_MIME_VERSION_SPANS_TWO_LINES = "Received: by 10.114.126.16 with HTTP; Thu, 6 Mar 2008 10:02:03 -0800 (PST)\r\n" +
-    "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-    "Subject: [Mime4J] getReader\r\n" +
-    "MIME-Version: 4.   \r\n" +
-    "  1\r\n" +
-    "Content-Type: text/plain; charset=US-ASCII\r\n" +
-    "Content-Transfer-Encoding: 7bit\r\n" +
-    "Content-Disposition: inline\r\n" +
-    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-    "\r\n" + ONE_PART_MIME_ASCII_BODY;
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+            "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+            "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+            "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+            "Subject: [Mime4J] getReader\r\n" +
+            "MIME-Version: 4.   \r\n" +
+            "  1\r\n" +
+            "Content-Type: text/plain; charset=US-ASCII\r\n" +
+            "Content-Transfer-Encoding: 7bit\r\n" +
+            "Content-Disposition: inline\r\n" +
+            "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+            "\r\n" + ONE_PART_MIME_ASCII_BODY;
 
     public static final String INNER_MAIL = "From: Timothy Tayler <tim@example.org>\r\n" +
-    "To: Joshua Tetley <joshua@example.org>\r\n" +
-    "Date: Tue, 12 Feb 2008 17:34:09 +0000 (GMT)\r\n" +
-    "Subject: Multipart Without RFC822 Part\r\n" +
-    "Content-Type: multipart/mixed;boundary=42\r\n\r\n" +
-    "--42\r\n" +
-    "Content-Type:text/plain; charset=US-ASCII\r\n\r\n" +
-    "First part of this mail\r\n" +
-    "--42\r\n" +
-    "Content-Type:text/plain; charset=US-ASCII\r\n\r\n" +
-    "Second part of this mail\r\n" +
-    "--42--\r\n";
+            "To: Joshua Tetley <joshua@example.org>\r\n" +
+            "Date: Tue, 12 Feb 2008 17:34:09 +0000 (GMT)\r\n" +
+            "Subject: Multipart Without RFC822 Part\r\n" +
+            "Content-Type: multipart/mixed;boundary=42\r\n\r\n" +
+            "--42\r\n" +
+            "Content-Type:text/plain; charset=US-ASCII\r\n\r\n" +
+            "First part of this mail\r\n" +
+            "--42\r\n" +
+            "Content-Type:text/plain; charset=US-ASCII\r\n\r\n" +
+            "Second part of this mail\r\n" +
+            "--42--\r\n";
 
     public static final String MAIL_WITH_RFC822_PART = "MIME-Version: 1.0\r\n" +
-    "From: Timothy Tayler <tim@example.org>\r\n" +
-    "To: Joshua Tetley <joshua@example.org>\r\n" +
-    "Date: Tue, 12 Feb 2008 17:34:09 +0000 (GMT)\r\n" +
-    "Subject: Multipart With RFC822 Part\r\n" +
-    "Content-Type: multipart/mixed;boundary=1729\r\n\r\n" +
-    "A short premable\r\n" +
-    "--1729\r\n\r\n" +
-    "First part has no headers\r\n" +
-    "--1729\r\n" +
-    "Content-Type: text/plain; charset=US-ASCII\r\n\r\n" +
-    "Second part is plain text\r\n" +
-    "--1729\r\n" +
-    "Content-Type: message/rfc822\r\n\r\n" +
-    INNER_MAIL +
-    "--1729\r\n" +
-    "Content-Type: text/plain; charset=US-ASCII\r\n\r\n" +
-    "Last part is plain text\r\n" +
-    "--1729--\r\n" +
-    "The End";
+            "From: Timothy Tayler <tim@example.org>\r\n" +
+            "To: Joshua Tetley <joshua@example.org>\r\n" +
+            "Date: Tue, 12 Feb 2008 17:34:09 +0000 (GMT)\r\n" +
+            "Subject: Multipart With RFC822 Part\r\n" +
+            "Content-Type: multipart/mixed;boundary=1729\r\n\r\n" +
+            "A short premable\r\n" +
+            "--1729\r\n\r\n" +
+            "First part has no headers\r\n" +
+            "--1729\r\n" +
+            "Content-Type: text/plain; charset=US-ASCII\r\n\r\n" +
+            "Second part is plain text\r\n" +
+            "--1729\r\n" +
+            "Content-Type: message/rfc822\r\n\r\n" +
+            INNER_MAIL +
+            "--1729\r\n" +
+            "Content-Type: text/plain; charset=US-ASCII\r\n\r\n" +
+            "Last part is plain text\r\n" +
+            "--1729--\r\n" +
+            "The End";
 
     public static final String ONE_PART_MIME_8859 = "Received: by 10.114.126.16 with HTTP; Thu, 6 Mar 2008 10:02:03 -0800 (PST)\r\n" +
-    "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-    "Subject: [Mime4J] getReader\r\n" +
-    "MIME-Version: 1.0\r\n" +
-    "Content-Type: text/plain; charset=ISO-8859-1\r\n" +
-    "Content-Transfer-Encoding: 8bit\r\n" +
-    "Content-Disposition: inline\r\n" +
-    "Content-ID: " + CONTENT_ID + "\r\n" +
-    "Content-Description: " + CONTENT_DESCRIPTION + "\r\n" +
-    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-    "\r\n" +
-    ONE_PART_MIME_8859_BODY;
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+            "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+            "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+            "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+            "Subject: [Mime4J] getReader\r\n" +
+            "MIME-Version: 1.0\r\n" +
+            "Content-Type: text/plain; charset=ISO-8859-1\r\n" +
+            "Content-Transfer-Encoding: 8bit\r\n" +
+            "Content-Disposition: inline\r\n" +
+            "Content-ID: " + CONTENT_ID + "\r\n" +
+            "Content-Description: " + CONTENT_DESCRIPTION + "\r\n" +
+            "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+            "\r\n" +
+            ONE_PART_MIME_8859_BODY;
 
     public static final String ONE_PART_MIME_BASE64_ASCII_HEADERS = "Received: by 10.114.126.16 with HTTP; Thu, 6 Mar 2008 10:02:03 -0800 (PST)\r\n" +
-    "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-    "Subject: [Mime4J] getReader\r\n" +
-    "MIME-Version: 1.0\r\n" +
-    "Content-Type: text/plain; charset=US-ASCII\r\n" +
-    "Content-Transfer-Encoding: base64\r\n" +
-    "Content-Disposition: inline\r\n" +
-    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-    "\r\n";
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+            "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+            "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+            "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+            "Subject: [Mime4J] getReader\r\n" +
+            "MIME-Version: 1.0\r\n" +
+            "Content-Type: text/plain; charset=US-ASCII\r\n" +
+            "Content-Transfer-Encoding: base64\r\n" +
+            "Content-Disposition: inline\r\n" +
+            "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+            "\r\n";
 
     public static final String ONE_PART_MIME_BASE64_LATIN1_HEADERS = "Received: by 10.114.126.16 with HTTP; Thu, 6 Mar 2008 10:02:03 -0800 (PST)\r\n" +
-    "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-    "Subject: [Mime4J] getReader\r\n" +
-    "MIME-Version: 1.0\r\n" +
-    "Content-Type: text/plain; charset=ISO-8859-1\r\n" +
-    "Content-Transfer-Encoding: base64\r\n" +
-    "Content-Disposition: inline\r\n" +
-    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-    "\r\n";
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+            "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+            "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+            "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+            "Subject: [Mime4J] getReader\r\n" +
+            "MIME-Version: 1.0\r\n" +
+            "Content-Type: text/plain; charset=ISO-8859-1\r\n" +
+            "Content-Transfer-Encoding: base64\r\n" +
+            "Content-Disposition: inline\r\n" +
+            "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+            "\r\n";
 
     public static final String ONE_PART_MIME_QUOTED_PRINTABLE_ASCII = "Received: by 10.114.126.16 with HTTP; Thu, 6 Mar 2008 10:02:03 -0800 (PST)\r\n" +
-    "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
-    "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
-    "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
-    "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
-    "Subject: [Mime4J] getReader\r\n" +
-    "MIME-Version: 1.0\r\n" +
-    "Content-Type: text/plain; charset=US-ASCII\r\n" +
-    "Content-Transfer-Encoding: Quoted-Printable\r\n" +
-    "Content-Disposition: inline\r\n" +
-    "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
-    "\r\n" + breakLines(ONE_PART_MIME_QUOTED_PRINTABLE_ASCII_BODY.replaceAll("\r\n", "=0D=0A"));
+            "Message-ID: <f470f68e0803061002n22bc4124he14015a4b6d6327f@mail.gmail.com>\r\n" +
+            "Date: Thu, 6 Mar 2008 18:02:03 +0000\r\n" +
+            "From: \"Robert Burrell Donkin\" <robertburrelldonkin@gmail.com>\r\n" +
+            "To: \"James Developers List\" <server-dev@james.apache.org>\r\n" +
+            "Subject: [Mime4J] getReader\r\n" +
+            "MIME-Version: 1.0\r\n" +
+            "Content-Type: text/plain; charset=US-ASCII\r\n" +
+            "Content-Transfer-Encoding: Quoted-Printable\r\n" +
+            "Content-Disposition: inline\r\n" +
+            "Delivered-To: robertburrelldonkin@gmail.com\r\n" +
+            "\r\n" + breakLines(ONE_PART_MIME_QUOTED_PRINTABLE_ASCII_BODY.replaceAll("\r\n", "=0D=0A"));
 
 
     public static final String RFC_SIMPLE =
             "From: Timothy Tayler <timothy@example.org>\r\n" +
-            "To: Samual Smith <samual@example.org>\r\n" +
-            "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
-            "Subject: A Simple Email\r\n" +
-            "\r\n" +
-            RFC822_SIMPLE_BODY;
+                    "To: Samual Smith <samual@example.org>\r\n" +
+                    "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
+                    "Subject: A Simple Email\r\n" +
+                    "\r\n" +
+                    RFC822_SIMPLE_BODY;
 
     public static final String MIME_RFC822_SIMPLE =
-        "From: Samual Smith <sam@example.org>\r\n" +
-        "To: Joshua Tetley <josh@example.org>\r\n" +
-        "Date: Thu, 14 Feb 2008 12:30:00 +0000 (GMT)\r\n" +
-        "Subject: FW: A Simple Email\r\n" +
-        "MIME-Version: 1.0\r\n" +
-        "Content-Type: message/rfc822\r\n" +
-        "\r\n" + RFC_SIMPLE;
+            "From: Samual Smith <sam@example.org>\r\n" +
+                    "To: Joshua Tetley <josh@example.org>\r\n" +
+                    "Date: Thu, 14 Feb 2008 12:30:00 +0000 (GMT)\r\n" +
+                    "Subject: FW: A Simple Email\r\n" +
+                    "MIME-Version: 1.0\r\n" +
+                    "Content-Type: message/rfc822\r\n" +
+                    "\r\n" + RFC_SIMPLE;
 
     public static final String MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_7BIT = "Sonnet XXXIII By William Shakespeare\r\n" +
             "\r\n" +
@@ -575,61 +575,61 @@ public class ExampleMail {
 
     public static final String MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_ONE =
             "From: Timothy Tayler <timothy@example.org>\r\n" +
-            "To: Samual Smith <samual@example.org>\r\n" +
-            "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
-            "Subject: A Multipart Email\r\n" +
-            "Content-Type: multipart/mixed;boundary=1729\r\n" +
-            "\r\n" +
-            "Start with a preamble\r\n" +
-            "\r\n" +
-            "--1729\r\n" +
-            "Content-Type: text/plain; charset=US-ASCII\r\n" +
-            "Content-Transfer-Encoding: 7bit\r\n\r\n";
+                    "To: Samual Smith <samual@example.org>\r\n" +
+                    "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
+                    "Subject: A Multipart Email\r\n" +
+                    "Content-Type: multipart/mixed;boundary=1729\r\n" +
+                    "\r\n" +
+                    "Start with a preamble\r\n" +
+                    "\r\n" +
+                    "--1729\r\n" +
+                    "Content-Type: text/plain; charset=US-ASCII\r\n" +
+                    "Content-Transfer-Encoding: 7bit\r\n\r\n";
 
     public static final String MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_TWO =
             "\r\n--1729\r\n" +
-            "Content-Type: text/plain; charset=US-ASCII\r\n" +
-            "Content-Transfer-Encoding: Quoted-Printable\r\n\r\n";
+                    "Content-Type: text/plain; charset=US-ASCII\r\n" +
+                    "Content-Transfer-Encoding: Quoted-Printable\r\n\r\n";
 
     public static final String MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_THREE =
             "\r\n--1729\r\n" +
-            "Content-Type: text/plain; charset=US-ASCII\r\n" +
-            "Content-Transfer-Encoding: base64\r\n\r\n";
+                    "Content-Type: text/plain; charset=US-ASCII\r\n" +
+                    "Content-Transfer-Encoding: base64\r\n\r\n";
 
     public static final String MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_END =
             "\r\n--1729--\r\n";
 
     public static final String MIME_MULTIPART_ALTERNATIVE =
-        "From: Timothy Tayler <timothy@example.org>\r\n" +
-        "To: Samual Smith <samual@example.org>\r\n" +
-        "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
-        "Subject: A Multipart Email\r\n" +
-        "Content-Type: multipart/alternative;boundary=1729\r\n\r\n" +
-        "Start with a preamble\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: application/xhtml+xml\r\n\r\n" +
-        "<!DOCTYPE html\r\n" +
-        "PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n" +
-        "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n" +
-        "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: text/plain; charset=US-ASCII\r\n\r\n" +
-        "Rhubarb!\r\n" +
-        "\r\n--1729\r\n" +
-        "Content-Type: text/html; charset=US-ASCII\r\n\r\n" +
-        "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
-        "\r\n--1729--\r\n" +
-        "This is the epilogue\r\n";
+            "From: Timothy Tayler <timothy@example.org>\r\n" +
+                    "To: Samual Smith <samual@example.org>\r\n" +
+                    "Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)\r\n" +
+                    "Subject: A Multipart Email\r\n" +
+                    "Content-Type: multipart/alternative;boundary=1729\r\n\r\n" +
+                    "Start with a preamble\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: application/xhtml+xml\r\n\r\n" +
+                    "<!DOCTYPE html\r\n" +
+                    "PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n" +
+                    "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n" +
+                    "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: text/plain; charset=US-ASCII\r\n\r\n" +
+                    "Rhubarb!\r\n" +
+                    "\r\n--1729\r\n" +
+                    "Content-Type: text/html; charset=US-ASCII\r\n\r\n" +
+                    "<html><head><title>Rhubarb</title></head><body>Rhubarb!</body></html>\r\n" +
+                    "\r\n--1729--\r\n" +
+                    "This is the epilogue\r\n";
 
 
     private static final byte[][] MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_BYTE_ARRAYS = {
-        ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_ONE),
-        ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_7BIT),
-        ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_TWO),
-        ascii(breakLines(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_QUOTED_PRINTABLE.replaceAll("\r\n", "=0D=0A"))),
-        ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_THREE),
-        EncodeUtils.toBase64(ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_BASE64)),
-        ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_END),
+            ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_ONE),
+            ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_7BIT),
+            ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_TWO),
+            ascii(breakLines(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_QUOTED_PRINTABLE.replaceAll("\r\n", "=0D=0A"))),
+            ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_THREE),
+            EncodeUtils.toBase64(ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_BASE64)),
+            ascii(MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_END),
     };
 
     public static final byte[] MIME_RFC822_SIMPLE_BYTES = ascii(MIME_RFC822_SIMPLE);
@@ -686,12 +686,12 @@ public class ExampleMail {
     public static String breakLines(String original) {
         StringBuilder buffer = new StringBuilder(original);
         int count = 76;
-        while(count < buffer.length()) {
+        while (count < buffer.length()) {
             if (buffer.charAt(count) == '=') {
                 count = count - 1;
-            } else if (buffer.charAt(count-1) == '=') {
+            } else if (buffer.charAt(count - 1) == '=') {
                 count = count - 4;
-            } else if (buffer.charAt(count-2) == '=') {
+            } else if (buffer.charAt(count - 2) == '=') {
                 count = count - 3;
             }
             buffer.insert(count, '\n');

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeExceptionTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeExceptionTest.java?rev=1426193&r1=1426192&r2=1426193&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeExceptionTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeExceptionTest.java Thu Dec 27 13:23:54 2012
@@ -19,28 +19,32 @@
 
 package org.apache.james.mime4j;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class MimeExceptionTest extends TestCase {
+public class MimeExceptionTest {
 
+    @Test
     public void testMimeExceptionString() {
         MimeException e = new MimeException("message");
-        assertEquals("message", e.getMessage());
-        assertNull(e.getCause());
+        Assert.assertEquals("message", e.getMessage());
+        Assert.assertNull(e.getCause());
     }
 
+    @Test
     public void testMimeExceptionThrowable() {
         NullPointerException npe = new NullPointerException("npe");
         MimeException e = new MimeException(npe);
-        assertSame(npe, e.getCause());
-        assertNotNull(e.getMessage());
+        Assert.assertSame(npe, e.getCause());
+        Assert.assertNotNull(e.getMessage());
     }
 
+    @Test
     public void testMimeExceptionStringThrowable() {
         NullPointerException npe = new NullPointerException("npe");
-        MimeException e = new MimeException("message",npe);
-        assertEquals("message", e.getMessage());
-        assertSame(npe, e.getCause());
+        MimeException e = new MimeException("message", npe);
+        Assert.assertEquals("message", e.getMessage());
+        Assert.assertSame(npe, e.getCause());
     }
 
 }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeIOExceptionTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeIOExceptionTest.java?rev=1426193&r1=1426192&r2=1426193&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeIOExceptionTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/MimeIOExceptionTest.java Thu Dec 27 13:23:54 2012
@@ -19,15 +19,17 @@
 
 package org.apache.james.mime4j;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class MimeIOExceptionTest extends TestCase {
+public class MimeIOExceptionTest {
 
+    @Test
     public void testMimeIOExceptionMimeException() {
         MimeException cause = new MimeException("cause");
         MimeIOException e = new MimeIOException(cause);
-        assertEquals("cause", e.getMessage());
-        assertSame(cause, e.getCause());
+        Assert.assertEquals("cause", e.getMessage());
+        Assert.assertSame(cause, e.getCause());
     }
 
 }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/TestUtil.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/TestUtil.java?rev=1426193&r1=1426192&r2=1426193&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/TestUtil.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/TestUtil.java Thu Dec 27 13:23:54 2012
@@ -19,14 +19,14 @@
 
 package org.apache.james.mime4j;
 
+import org.apache.commons.io.IOUtils;
+
 import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.commons.io.IOUtils;
-
 public class TestUtil {
-    public static final String[] TEST_MESSAGES = new String[] {
+    public static final String[] TEST_MESSAGES = new String[]{
             "2002_06_12_doublebound",
             "ak-0696",
             "bluedot-postcard",

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java?rev=1426193&r1=1426192&r2=1426193&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java Thu Dec 27 13:23:54 2012
@@ -19,6 +19,11 @@
 
 package org.apache.james.mime4j.codec;
 
+import org.apache.commons.io.output.NullOutputStream;
+import org.junit.Assert;
+import static org.junit.Assert.fail;
+import org.junit.Test;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -26,12 +31,9 @@ import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.Random;
 
-import org.apache.commons.io.output.NullOutputStream;
-
-import junit.framework.TestCase;
-
-public class Base64InputStreamTest extends TestCase {
+public class Base64InputStreamTest {
 
+    @Test
     public void testDecode() throws IOException {
         ByteArrayInputStream bis = null;
         Base64InputStream decoder = null;
@@ -43,7 +45,7 @@ public class Base64InputStreamTest exten
         bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ=="));
         decoder = new Base64InputStream(bis);
-        assertEquals("This is the plain text message!", toString(read(decoder)));
+        Assert.assertEquals("This is the plain text message!", toString(read(decoder)));
 
         /*
          * Test encoded text padded once, twice and not at all.
@@ -52,17 +54,17 @@ public class Base64InputStreamTest exten
                 fromString("VGhpcyBpcyBhIHRleHQgd2hpY2ggaGFzIHRvIGJl"
                         + "IHBhZGRlZCBvbmNlLi4="));
         decoder = new Base64InputStream(bis);
-        assertEquals("This is a text which has to be padded once..", toString(read(decoder)));
+        Assert.assertEquals("This is a text which has to be padded once..", toString(read(decoder)));
         bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyBhIHRleHQgd2hpY2ggaGFzIHRvIGJl"
                         + "IHBhZGRlZCB0d2ljZQ=="));
         decoder = new Base64InputStream(bis);
-        assertEquals("This is a text which has to be padded twice", toString(read(decoder)));
+        Assert.assertEquals("This is a text which has to be padded twice", toString(read(decoder)));
         bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyBhIHRleHQgd2hpY2ggd2lsbCBub3Qg"
                         + "YmUgcGFkZGVk"));
         decoder = new Base64InputStream(bis);
-        assertEquals("This is a text which will not be padded", toString(read(decoder)));
+        Assert.assertEquals("This is a text which will not be padded", toString(read(decoder)));
 
         /*
          * Test that non base64 characters are ignored.
@@ -71,42 +73,42 @@ public class Base64InputStreamTest exten
                 fromString(" &% VGhp\r\ncyBp\r\ncyB0aGUgcGxhaW4g "
                         + " \tdGV4dCBtZ?!XNzY*WdlIQ=="));
         decoder = new Base64InputStream(bis);
-        assertEquals("This is the plain text message!", toString(read(decoder)));
+        Assert.assertEquals("This is the plain text message!", toString(read(decoder)));
 
         /*
          * Test that the bytes 0-255 shifted 0, 1 and 2 positions are
          * decoded properly.
          */
         String s1 = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCU"
-                  + "mJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0"
-                  + "xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bxc"
-                  + "nN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeY"
-                  + "mZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6"
-                  + "/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5O"
-                  + "Xm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==";
+                + "mJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0"
+                + "xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bxc"
+                + "nN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeY"
+                + "mZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6"
+                + "/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5O"
+                + "Xm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==";
 
         String s2 = "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSY"
-                  + "nKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE"
-                  + "1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc"
-                  + "3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZ"
-                  + "mpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/"
-                  + "AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5e"
-                  + "bn6Onq6+zt7u/w8fLz9PX29/j5+vv8/f7/AA==";
+                + "nKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE"
+                + "1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc"
+                + "3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZ"
+                + "mpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/"
+                + "AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5e"
+                + "bn6Onq6+zt7u/w8fLz9PX29/j5+vv8/f7/AA==";
 
         String s3 = "AgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJic"
-                  + "oKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU"
-                  + "5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzd"
-                  + "HV2d3h5ent8fX5/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJma"
-                  + "m5ydnp+goaKjpKWmp6ipqqusra6vsLGys7S1tre4ubq7vL2+v8D"
-                  + "BwsPExcbHyMnKy8zNzs/Q0dLT1NXW19jZ2tvc3d7f4OHi4+Tl5u"
-                  + "fo6err7O3u7/Dx8vP09fb3+Pn6+/z9/v8AAQ==";
+                + "oKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU"
+                + "5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzd"
+                + "HV2d3h5ent8fX5/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJma"
+                + "m5ydnp+goaKjpKWmp6ipqqusra6vsLGys7S1tre4ubq7vL2+v8D"
+                + "BwsPExcbHyMnKy8zNzs/Q0dLT1NXW19jZ2tvc3d7f4OHi4+Tl5u"
+                + "fo6err7O3u7/Dx8vP09fb3+Pn6+/z9/v8AAQ==";
 
         bis = new ByteArrayInputStream(fromString(s1));
         decoder = new Base64InputStream(bis);
         bytes = read(decoder);
 
         for (int i = 0; i < bytes.length; i++) {
-            assertEquals("Position " + i, bytes[i], (byte) i);
+            Assert.assertEquals("Position " + i, bytes[i], (byte) i);
         }
 
         bis = new ByteArrayInputStream(fromString(s2));
@@ -114,7 +116,7 @@ public class Base64InputStreamTest exten
         bytes = read(decoder);
 
         for (int i = 0; i < bytes.length; i++) {
-            assertEquals("Position " + i, bytes[i], (byte) (i + 1));
+            Assert.assertEquals("Position " + i, bytes[i], (byte) (i + 1));
         }
 
         bis = new ByteArrayInputStream(fromString(s3));
@@ -122,10 +124,11 @@ public class Base64InputStreamTest exten
         bytes = read(decoder);
 
         for (int i = 0; i < bytes.length; i++) {
-            assertEquals("Position " + i, bytes[i], (byte) (i + 2));
+            Assert.assertEquals("Position " + i, bytes[i], (byte) (i + 2));
         }
     }
 
+    @Test
     public void testDecodePrematureClose() throws IOException {
         ByteArrayInputStream bis = null;
         Base64InputStream decoder = null;
@@ -133,17 +136,18 @@ public class Base64InputStreamTest exten
         bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ=="));
         decoder = new Base64InputStream(bis);
-        assertEquals('T', decoder.read());
-        assertEquals('h', decoder.read());
+        Assert.assertEquals('T', decoder.read());
+        Assert.assertEquals('h', decoder.read());
         decoder.close();
 
         try {
             decoder.read();
-            fail();
+            Assert.fail();
         } catch (IOException expected) {
         }
     }
 
+    @Test
     public void testRoundtripWithVariousBufferSizes() throws Exception {
         byte[] data = new byte[3719];
         new Random(0).nextBytes(data);
@@ -165,9 +169,9 @@ public class Base64InputStreamTest exten
 
             byte[] decoded = dOut.toByteArray();
 
-            assertEquals(data.length, decoded.length);
+            Assert.assertEquals(data.length, decoded.length);
             for (int i = 0; i < data.length; i++) {
-                assertEquals(data[i], decoded[i]);
+                Assert.assertEquals(data[i], decoded[i]);
             }
         }
     }
@@ -175,6 +179,7 @@ public class Base64InputStreamTest exten
     /**
      * Tests {@link InputStream#read()}
      */
+    @Test
     public void testReadInt() throws Exception {
         ByteArrayInputStream bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ=="));
@@ -188,72 +193,77 @@ public class Base64InputStreamTest exten
             out.write(x);
         }
 
-        assertEquals("This is the plain text message!", toString(out
+        Assert.assertEquals("This is the plain text message!", toString(out
                 .toByteArray()));
     }
 
     /**
      * Tests {@link InputStream#read(byte[], int, int)} with various offsets
      */
+    @Test
     public void testReadOffset() throws Exception {
         ByteArrayInputStream bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ=="));
         Base64InputStream decoder = new Base64InputStream(bis);
 
         byte[] data = new byte[36];
-        for (int i = 0;;) {
+        for (int i = 0; ; ) {
             int bytes = decoder.read(data, i, 5);
             if (bytes == -1)
                 break;
             i += bytes;
         }
 
-        assertEquals("This is the plain text message!\0\0\0\0\0",
+        Assert.assertEquals("This is the plain text message!\0\0\0\0\0",
                 toString(data));
     }
 
+    @Test
     public void testStrictUnexpectedEof() throws Exception {
         ByteArrayInputStream bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlI"));
         Base64InputStream decoder = new Base64InputStream(bis, true);
         try {
             CodecUtil.copy(decoder, new NullOutputStream());
-            fail();
+            Assert.fail();
         } catch (IOException expected) {
-            assertTrue(expected.getMessage().toLowerCase().contains(
+            Assert.assertTrue(expected.getMessage().toLowerCase().contains(
                     "end of base64 stream"));
         }
     }
 
+    @Test
     public void testLenientUnexpectedEof() throws Exception {
         ByteArrayInputStream bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlI"));
         Base64InputStream decoder = new Base64InputStream(bis, false);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         CodecUtil.copy(decoder, out);
-        assertEquals("This is the plain text message", toString(out
+        Assert.assertEquals("This is the plain text message", toString(out
                 .toByteArray()));
     }
 
+    @Test
     public void testStrictUnexpectedPad() throws Exception {
         ByteArrayInputStream bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlI="));
         Base64InputStream decoder = new Base64InputStream(bis, true);
         try {
             CodecUtil.copy(decoder, new NullOutputStream());
-            fail();
+            Assert.fail();
         } catch (IOException expected) {
-            assertTrue(expected.getMessage().toLowerCase().contains("pad"));
+            Assert.assertTrue(expected.getMessage().toLowerCase().contains("pad"));
         }
     }
 
+    @Test
     public void testLenientUnexpectedPad() throws Exception {
         ByteArrayInputStream bis = new ByteArrayInputStream(
                 fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlI="));
         Base64InputStream decoder = new Base64InputStream(bis, false);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         CodecUtil.copy(decoder, out);
-        assertEquals("This is the plain text message", toString(out
+        Assert.assertEquals("This is the plain text message", toString(out
                 .toByteArray()));
     }
 

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64OutputStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64OutputStreamTest.java?rev=1426193&r1=1426192&r2=1426193&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64OutputStreamTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/Base64OutputStreamTest.java Thu Dec 27 13:23:54 2012
@@ -19,15 +19,18 @@
 
 package org.apache.james.mime4j.codec;
 
+import org.junit.Assert;
+import static org.junit.Assert.fail;
+import org.junit.Test;
+
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 
-import junit.framework.TestCase;
-
-public class Base64OutputStreamTest extends TestCase {
+public class Base64OutputStreamTest {
 
+    @Test
     public void testEncode() throws IOException {
         ByteArrayOutputStream bos = null;
         Base64OutputStream encoder = null;
@@ -39,9 +42,10 @@ public class Base64OutputStreamTest exte
         encoder = new Base64OutputStream(bos);
         encoder.write(fromString("This is the plain text message!"));
         encoder.close();
-        assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\n", toString(bos.toByteArray()));
+        Assert.assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\n", toString(bos.toByteArray()));
     }
 
+    @Test
     public void testEncodeUnderlyingStreamStaysOpen() throws IOException {
         ByteArrayOutputStream bos = null;
         Base64OutputStream encoder = null;
@@ -53,7 +57,7 @@ public class Base64OutputStreamTest exte
 
         try {
             encoder.write('b');
-            fail();
+            Assert.fail();
         } catch (IOException expected) {
         }
 
@@ -61,40 +65,43 @@ public class Base64OutputStreamTest exte
         bos.write('a');
         bos.write('d');
         bos.write('a');
-        assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\nyada", toString(bos.toByteArray()));
+        Assert.assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\nyada", toString(bos.toByteArray()));
     }
 
+    @Test
     public void testNoLineSeparators() throws IOException {
-        assertEquals("", encodeNoLs(""));
-        assertEquals("YQ==", encodeNoLs("a"));
-        assertEquals("YWI=", encodeNoLs("ab"));
-        assertEquals("YWJj", encodeNoLs("abc"));
-        assertEquals("YWJjZA==", encodeNoLs("abcd"));
-        assertEquals("YWJjZGU=", encodeNoLs("abcde"));
-        assertEquals("YWJjZGVm", encodeNoLs("abcdef"));
-        assertEquals("YWJjZGVmZw==", encodeNoLs("abcdefg"));
-        assertEquals("YWJjZGVmZ2g=", encodeNoLs("abcdefgh"));
-        assertEquals("YWJjZGVmZ2hp", encodeNoLs("abcdefghi"));
-        assertEquals("DQoMCQ==", encodeNoLs("\r\n\f\t"));
-        assertEquals("LT0/VGhhdCdzIGEgdGVzdD89LQ==",
+        Assert.assertEquals("", encodeNoLs(""));
+        Assert.assertEquals("YQ==", encodeNoLs("a"));
+        Assert.assertEquals("YWI=", encodeNoLs("ab"));
+        Assert.assertEquals("YWJj", encodeNoLs("abc"));
+        Assert.assertEquals("YWJjZA==", encodeNoLs("abcd"));
+        Assert.assertEquals("YWJjZGU=", encodeNoLs("abcde"));
+        Assert.assertEquals("YWJjZGVm", encodeNoLs("abcdef"));
+        Assert.assertEquals("YWJjZGVmZw==", encodeNoLs("abcdefg"));
+        Assert.assertEquals("YWJjZGVmZ2g=", encodeNoLs("abcdefgh"));
+        Assert.assertEquals("YWJjZGVmZ2hp", encodeNoLs("abcdefghi"));
+        Assert.assertEquals("DQoMCQ==", encodeNoLs("\r\n\f\t"));
+        Assert.assertEquals("LT0/VGhhdCdzIGEgdGVzdD89LQ==",
                 encodeNoLs("-=?That's a test?=-"));
     }
 
+    @Test
     public void testLineSeparators() throws IOException {
-        assertEquals("", encodeLs(""));
-        assertEquals("YQ==\r\n", encodeLs("a"));
-        assertEquals("YWJjZA==\r\n", encodeLs("abcd"));
-        assertEquals("YWJjZGVmZw==\r\n", encodeLs("abcdefg"));
-        assertEquals("YWJjZGVmZ2g=\r\n", encodeLs("abcdefgh"));
-        assertEquals("YWJjZGVmZ2hp\r\n", encodeLs("abcdefghi"));
-        assertEquals("YWJjZGVmZ2hp\r\nag==\r\n", encodeLs("abcdefghij"));
-        assertEquals("YWJjZGVmZ2hp\r\nams=\r\n", encodeLs("abcdefghijk"));
-        assertEquals("YWJjZGVmZ2hp\r\namts\r\n", encodeLs("abcdefghijkl"));
+        Assert.assertEquals("", encodeLs(""));
+        Assert.assertEquals("YQ==\r\n", encodeLs("a"));
+        Assert.assertEquals("YWJjZA==\r\n", encodeLs("abcd"));
+        Assert.assertEquals("YWJjZGVmZw==\r\n", encodeLs("abcdefg"));
+        Assert.assertEquals("YWJjZGVmZ2g=\r\n", encodeLs("abcdefgh"));
+        Assert.assertEquals("YWJjZGVmZ2hp\r\n", encodeLs("abcdefghi"));
+        Assert.assertEquals("YWJjZGVmZ2hp\r\nag==\r\n", encodeLs("abcdefghij"));
+        Assert.assertEquals("YWJjZGVmZ2hp\r\nams=\r\n", encodeLs("abcdefghijk"));
+        Assert.assertEquals("YWJjZGVmZ2hp\r\namts\r\n", encodeLs("abcdefghijkl"));
     }
 
     /**
      * tests {@link OutputStream#write(int)}
      */
+    @Test
     public void testWriteInt() throws IOException {
         byte[] bytes = fromString("123456789012345678901234567890123456789012"
                 + "3456789012345678901234567890123456789012345678901234567890"
@@ -115,12 +122,13 @@ public class Base64OutputStreamTest exte
                 + "OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0\r\nNQ==\r"
                 + "\n";
 
-        assertEquals(expected, actual);
+        Assert.assertEquals(expected, actual);
     }
 
     /**
      * tests {@link OutputStream#write(byte[], int, int)} with various offsets
      */
+    @Test
     public void testWriteOffset() throws IOException {
         byte[] bytes = fromString("123456789012345678901234567890123456789012"
                 + "3456789012345678901234567890123456789012345678901234567890"
@@ -143,12 +151,13 @@ public class Base64OutputStreamTest exte
                 + "OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0\r\nNQ==\r"
                 + "\n";
 
-        assertEquals(expected, actual);
+        Assert.assertEquals(expected, actual);
     }
 
     /**
      * tests {@link OutputStream#flush()} while writing
      */
+    @Test
     public void testWriteFlush() throws IOException {
         byte[] bytes = fromString("123456789012345678901234567890123456789012"
                 + "3456789012345678901234567890123456789012345678901234567890"
@@ -172,15 +181,15 @@ public class Base64OutputStreamTest exte
                 + "OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0\r\nNQ==\r"
                 + "\n";
 
-        assertEquals(expected, actual);
+        Assert.assertEquals(expected, actual);
     }
 
     private String encodeNoLs(String str) throws IOException {
-        return encode(str, 0, new byte[] {});
+        return encode(str, 0, new byte[]{});
     }
 
     private String encodeLs(String str) throws IOException {
-        return encode(str, 12, new byte[] { '\r', '\n' });
+        return encode(str, 12, new byte[]{'\r', '\n'});
     }
 
     private String encode(String str, int lineLength, byte[] lineSeparator)

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/CodecUtilTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/CodecUtilTest.java?rev=1426193&r1=1426192&r2=1426193&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/CodecUtilTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/codec/CodecUtilTest.java Thu Dec 27 13:23:54 2012
@@ -20,26 +20,17 @@
 package org.apache.james.mime4j.codec;
 
 import org.apache.james.mime4j.ExampleMail;
+import org.junit.Assert;
+import org.junit.Test;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
-import junit.framework.TestCase;
-
-public class CodecUtilTest extends TestCase {
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
+public class CodecUtilTest {
 
+    @Test
     public void testCopy() throws Exception {
         byte[] content = ExampleMail.MULTIPART_WITH_BINARY_ATTACHMENTS_BYTES;
         ByteArrayInputStream in = new ByteArrayInputStream(content);
@@ -48,6 +39,7 @@ public class CodecUtilTest extends TestC
         assertEquals(content, out.toByteArray());
     }
 
+    @Test
     public void testEncodeQuotedPrintableLargeInput() throws Exception {
         StringBuilder sb = new StringBuilder();
         for (int i = 0; i < 1024 * 5; i++) {
@@ -59,18 +51,20 @@ public class CodecUtilTest extends TestC
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         CodecUtil.encodeQuotedPrintableBinary(in, out);
         String actual = new String(out.toByteArray(), "US-ASCII");
-        assertEquals(expected, actual);
+        Assert.assertEquals(expected, actual);
     }
 
+    @Test
     public void testEncodeQuotedPrintableNonAsciiChars() throws Exception {
         String s = "7bit content with euro \u20AC symbol";
         InputStream in = new ByteArrayInputStream(s.getBytes("iso-8859-15"));
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         CodecUtil.encodeQuotedPrintableBinary(in, out);
         String actual = new String(out.toByteArray(), "US-ASCII");
-        assertEquals("7bit=20content=20with=20euro=20=A4=20symbol", actual);
+        Assert.assertEquals("7bit=20content=20with=20euro=20=A4=20symbol", actual);
     }
 
+    @Test
     public void testBase64OutputStream() throws Exception {
         StringBuilder sb = new StringBuilder(2048);
         for (int i = 0; i < 128; i++) {
@@ -78,7 +72,7 @@ public class CodecUtilTest extends TestC
         }
         String input = sb.toString();
         String output = roundtripUsingOutputStream(input);
-        assertEquals(input, output);
+        Assert.assertEquals(input, output);
     }
 
     private String roundtripUsingOutputStream(String input) throws IOException {
@@ -98,6 +92,7 @@ public class CodecUtilTest extends TestC
     /**
      * This test is a proof for MIME4J-67
      */
+    @Test
     public void testBase64Encoder() throws Exception {
         StringBuilder sb = new StringBuilder(2048);
         for (int i = 0; i < 128; i++) {
@@ -105,7 +100,7 @@ public class CodecUtilTest extends TestC
         }
         String input = sb.toString();
         String output = roundtripUsingEncoder(input);
-        assertEquals(input, output);
+        Assert.assertEquals(input, output);
     }
 
     private String roundtripUsingEncoder(String input) throws IOException {
@@ -154,10 +149,10 @@ public class CodecUtilTest extends TestC
 
     private void assertEquals(byte[] expected, byte[] actual) {
         StringBuilder buffer = new StringBuilder(expected.length);
-        assertEquals(expected.length, actual.length);
+        Assert.assertEquals(expected.length, actual.length);
         for (int i = 0; i < actual.length; i++) {
-            buffer.append((char)actual[i]);
-            assertEquals("Mismatch@" + i, expected[i], actual[i]);
+            buffer.append((char) actual[i]);
+            Assert.assertEquals("Mismatch@" + i, expected[i], actual[i]);
         }
     }
 }



Mime
View raw message