Permalink
Browse files

MIME4J-221 Updated most tests to junit-4 style

git-svn-id: https://svn.apache.org/repos/asf/james/mime4j/trunk@1426193 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent a1b701c commit 4b59934fef38ccd8d5a44286632dad872192fa01 Ioan Eugen Stan committed Dec 27, 2012
Showing with 2,964 additions and 2,625 deletions.
  1. +375 −375 core/src/test/java/org/apache/james/mime4j/ExampleMail.java
  2. +13 −9 core/src/test/java/org/apache/james/mime4j/MimeExceptionTest.java
  3. +6 −4 core/src/test/java/org/apache/james/mime4j/MimeIOExceptionTest.java
  4. +3 −3 core/src/test/java/org/apache/james/mime4j/TestUtil.java
  5. +55 −45 core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
  6. +41 −32 core/src/test/java/org/apache/james/mime4j/codec/Base64OutputStreamTest.java
  7. +15 −20 core/src/test/java/org/apache/james/mime4j/codec/CodecUtilTest.java
  8. +64 −48 core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java
  9. +71 −58 core/src/test/java/org/apache/james/mime4j/codec/EncoderUtilTest.java
  10. +20 −25 core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableEncodeTest.java
  11. +44 −24 core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableInputStreamTest.java
  12. +14 −8 core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableOutputStreamTest.java
  13. +28 −26 core/src/test/java/org/apache/james/mime4j/codec/QuotedPrintableTextEncodeTest.java
  14. +61 −53 core/src/test/java/org/apache/james/mime4j/io/BufferedLineReaderInputStreamBufferTest.java
  15. +31 −30 core/src/test/java/org/apache/james/mime4j/io/BufferedLineReaderInputStreamTest.java
  16. +12 −12 core/src/test/java/org/apache/james/mime4j/io/EOLConvertingInputStreamTest.java
  17. +14 −12 core/src/test/java/org/apache/james/mime4j/io/LimitedInputStreamTest.java
  18. +18 −17 core/src/test/java/org/apache/james/mime4j/io/LineNumberInputStreamTest.java
  19. +31 −29 core/src/test/java/org/apache/james/mime4j/io/LineReaderInputStreamAdaptorTest.java
  20. +63 −56 core/src/test/java/org/apache/james/mime4j/io/MimeBoundaryInputStreamTest.java
  21. +23 −21 core/src/test/java/org/apache/james/mime4j/io/PositionInputStreamTest.java
  22. +7 −9 core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserExampleMessagesTest.java
  23. +94 −83 core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
  24. +16 −17 core/src/test/java/org/apache/james/mime4j/stream/MimeTokenEmbeddedMessageTest.java
  25. +33 −29 core/src/test/java/org/apache/james/mime4j/stream/MimeTokenNoRecurseTest.java
  26. +53 −56 core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamBodyDescriptorTest.java
  27. +51 −49 core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamReaderTest.java
  28. +9 −7 core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamTest.java
  29. +41 −39 core/src/test/java/org/apache/james/mime4j/stream/MultipartStreamTest.java
  30. +133 −128 core/src/test/java/org/apache/james/mime4j/stream/MultipartTokensTest.java
  31. +118 −96 core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java
  32. +7 −5 core/src/test/java/org/apache/james/mime4j/stream/RawFieldTest.java
  33. +24 −25 core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java
  34. +70 −65 .../src/test/java/org/apache/james/mime4j/util/{TestByteArrayBuffer.java → ByteArrayBufferTest.java}
  35. +16 −10 core/src/test/java/org/apache/james/mime4j/util/CharsetUtilTest.java
  36. +26 −22 core/src/test/java/org/apache/james/mime4j/util/MimeUtilTest.java
  37. +9 −11 dom/src/test/java/org/apache/james/mime4j/dom/ExampleMessagesRoundtripTest.java
  38. +36 −31 dom/src/test/java/org/apache/james/mime4j/dom/HeaderTest.java
  39. +12 −21 dom/src/test/java/org/apache/james/mime4j/dom/MessageCompleteMailTest.java
  40. +18 −18 dom/src/test/java/org/apache/james/mime4j/dom/MessageHeadlessParserTest.java
  41. +16 −22 dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
  42. +8 −6 dom/src/test/java/org/apache/james/mime4j/dom/MessageServiceFactoryTest.java
  43. +116 −95 dom/src/test/java/org/apache/james/mime4j/dom/MessageTest.java
  44. +19 −23 dom/src/test/java/org/apache/james/mime4j/dom/MessageWriteToTest.java
  45. +52 −49 dom/src/test/java/org/apache/james/mime4j/dom/MimeBuilderCopyTest.java
  46. +20 −21 dom/src/test/java/org/apache/james/mime4j/dom/MultipartFormTest.java
  47. +34 −29 dom/src/test/java/org/apache/james/mime4j/field/ContentTypeFieldTest.java
  48. +112 −86 dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java
  49. +63 −54 dom/src/test/java/org/apache/james/mime4j/field/LenientContentDispositionFieldTest.java
  50. +27 −22 dom/src/test/java/org/apache/james/mime4j/field/LenientContentLanguageFieldTest.java
  51. +11 −7 dom/src/test/java/org/apache/james/mime4j/field/LenientContentLocationFieldTest.java
  52. +32 −27 dom/src/test/java/org/apache/james/mime4j/field/LenientContentTypeFieldTest.java
  53. +15 −11 dom/src/test/java/org/apache/james/mime4j/field/LenientDateTimeFieldTest.java
  54. +23 −15 dom/src/test/java/org/apache/james/mime4j/field/LenientMimeVersionParserTest.java
  55. +11 −6 dom/src/test/java/org/apache/james/mime4j/field/MimeVersionParserTest.java
  56. +7 −7 dom/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java
  57. +40 −33 dom/src/test/java/org/apache/james/mime4j/field/address/AddressTest.java
  58. +110 −94 dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressBuilderTest.java
  59. +24 −19 dom/src/test/java/org/apache/james/mime4j/field/address/DefaultAddressFormatterTest.java
  60. +153 −123 dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
  61. +5 −4 dom/src/test/java/org/apache/james/mime4j/field/contentdisposition/ContentDispositionTest.java
  62. +8 −6 dom/src/test/java/org/apache/james/mime4j/field/contenttype/ContentTypeTest.java
  63. +57 −55 dom/src/test/java/org/apache/james/mime4j/field/datetime/DateTimeTest.java
  64. +11 −17 dom/src/test/java/org/apache/james/mime4j/field/mimeversion/MimeVersionParserTest.java
  65. +20 −24 dom/src/test/java/org/apache/james/mime4j/field/structured/StructuredFieldParserTest.java
  66. +104 −81 dom/src/test/java/org/apache/james/mime4j/message/MaximalBodyDescriptorTest.java
  67. +26 −17 dom/src/test/java/org/apache/james/mime4j/message/StringInputStreamTest.java
  68. +1 −0 pom.xml
  69. +12 −7 storage/src/test/java/org/apache/james/mime4j/storage/DefaultStorageProviderTest.java
  70. +16 −10 storage/src/test/java/org/apache/james/mime4j/storage/MultiReferenceStorageTest.java
  71. +21 −16 storage/src/test/java/org/apache/james/mime4j/storage/SingleBodyCopyTest.java
  72. +15 −11 storage/src/test/java/org/apache/james/mime4j/storage/StorageProviderTest.java
View
750 core/src/test/java/org/apache/james/mime4j/ExampleMail.java
@@ -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 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 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 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 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');
View
22 core/src/test/java/org/apache/james/mime4j/MimeExceptionTest.java
@@ -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());
}
}
View
10 core/src/test/java/org/apache/james/mime4j/MimeIOExceptionTest.java
@@ -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());
}
}
View
6 core/src/test/java/org/apache/james/mime4j/TestUtil.java
@@ -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",
View
100 core/src/test/java/org/apache/james/mime4j/codec/Base64InputStreamTest.java
@@ -19,19 +19,21 @@
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;
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 void testDecode() throws IOException {
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 void testDecode() throws IOException {
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,79 +73,81 @@ public void testDecode() throws IOException {
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));
decoder = new Base64InputStream(bis);
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));
decoder = new Base64InputStream(bis);
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;
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,16 +169,17 @@ public void testRoundtripWithVariousBufferSizes() throws Exception {
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]);
}
}
}
/**
* Tests {@link InputStream#read()}
*/
+ @Test
public void testReadInt() throws Exception {
ByteArrayInputStream bis = new ByteArrayInputStream(
fromString("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ=="));
@@ -188,72 +193,77 @@ public void testReadInt() throws Exception {
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()));
}
View
73 core/src/test/java/org/apache/james/mime4j/codec/Base64OutputStreamTest.java
@@ -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 void testEncode() throws IOException {
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,48 +57,51 @@ public void testEncodeUnderlyingStreamStaysOpen() throws IOException {
try {
encoder.write('b');
- fail();
+ Assert.fail();
} catch (IOException expected) {
}
bos.write('y');
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 void testWriteInt() throws IOException {
+ "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 void testWriteOffset() throws IOException {
+ "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 void testWriteFlush() throws IOException {
+ "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)
View
35 core/src/test/java/org/apache/james/mime4j/codec/CodecUtilTest.java
@@ -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 void testCopy() throws Exception {
assertEquals(content, out.toByteArray());
}
+ @Test
public void testEncodeQuotedPrintableLargeInput() throws Exception {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 1024 * 5; i++) {
@@ -59,26 +51,28 @@ public void testEncodeQuotedPrintableLargeInput() throws Exception {
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++) {
sb.append("0123456789ABCDEF");
}
String input = sb.toString();
String output = roundtripUsingOutputStream(input);
- assertEquals(input, output);
+ Assert.assertEquals(input, output);
}
private String roundtripUsingOutputStream(String input) throws IOException {
@@ -98,14 +92,15 @@ private String roundtripUsingOutputStream(String input) throws IOException {
/**
* 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++) {
sb.append("0123456789ABCDEF");
}
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 void testPerformance() throws Exception {
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]);
}
}
}
View
112 core/src/test/java/org/apache/james/mime4j/codec/DecoderUtilTest.java
@@ -19,124 +19,140 @@
package org.apache.james.mime4j.codec;
+import org.junit.Assert;
+import org.junit.Test;
+
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
-import junit.framework.TestCase;
-
-public class DecoderUtilTest extends TestCase {
+public class DecoderUtilTest {
+ @Test
public void testDecodeB() throws UnsupportedEncodingException {
String s = DecoderUtil.decodeB("VGhpcyBpcyB0aGUgcGxhaW4gd"
- + "GV4dCBtZXNzYWdlIQ==", "ISO8859-1", DecodeMonitor.STRICT);
- assertEquals("This is the plain text message!", s);
+ + "GV4dCBtZXNzYWdlIQ==", "ISO8859-1", DecodeMonitor.STRICT);
+ Assert.assertEquals("This is the plain text message!", s);
}
+ @Test
public void testDecodeQ() throws UnsupportedEncodingException {
String s = DecoderUtil.decodeQ("=e1_=e2=09=E3_=E4_", "ISO8859-1", DecodeMonitor.STRICT);
- assertEquals("\u00e1 \u00e2\t\u00e3 \u00e4 ", s);
+ Assert.assertEquals("\u00e1 \u00e2\t\u00e3 \u00e4 ", s);
}
+ @Test
public void testNonEncodedWordsAreIgnored() {
- assertEquals("", DecoderUtil.decodeEncodedWords(""));
- assertEquals("Yada yada", DecoderUtil.decodeEncodedWords("Yada yada"));
+ Assert.assertEquals("", DecoderUtil.decodeEncodedWords(""));
+ Assert.assertEquals("Yada yada", DecoderUtil.decodeEncodedWords("Yada yada"));
}
+ @Test
public void testDecodeSomeEncodedWords() {
- assertEquals(" \u00e1\u00e2\u00e3\t\u00e4",
+ Assert.assertEquals(" \u00e1\u00e2\u00e3\t\u00e4",
DecoderUtil.decodeEncodedWords("=?iso-8859-1?Q?_=20=e1=e2=E3=09=E4?="));
- assertEquals("Word 1 ' \u00e2\u00e3\t\u00e4'. Word 2 ' \u00e2\u00e3\t\u00e4'",
+ Assert.assertEquals("Word 1 ' \u00e2\u00e3\t\u00e4'. Word 2 ' \u00e2\u00e3\t\u00e4'",
DecoderUtil.decodeEncodedWords("Word 1 '=?iso-8859-1?Q?_=20=e2=E3=09=E4?="
+ "'. Word 2 '=?iso-8859-1?q?_=20=e2=E3=09=E4?='"));
- assertEquals("=?iso-8859-YADA?Q?_=20=t1=e2=E3=09=E4?=",
+ Assert.assertEquals("=?iso-8859-YADA?Q?_=20=t1=e2=E3=09=E4?=",
DecoderUtil.decodeEncodedWords("=?iso-8859-YADA?Q?_=20=t1=e2=E3=09=E4?="));
- assertEquals("A short text",
+ Assert.assertEquals("A short text",
DecoderUtil.decodeEncodedWords("=?US-ASCII?B?QSBzaG9ydCB0ZXh0?="));
- assertEquals("A short text again!",
+ Assert.assertEquals("A short text again!",
DecoderUtil.decodeEncodedWords("=?US-ASCII?b?QSBzaG9ydCB0ZXh0IGFnYWluIQ==?="));
}
+ @Test
public void testDecodeJapaneseEncodedWords() {
String enc = "=?ISO-2022-JP?B?GyRCTCQbKEobJEI+NRsoShskQkJ6GyhKGyRCOS0bKEo=?= "
- + "=?ISO-2022-JP?B?GyRCOXAbKEobJEIiKBsoShskQiU1GyhKGyRCJSQbKEo=?= "
- + "=?ISO-2022-JP?B?GyRCJUkbKEobJEIlUxsoShskQiU4GyhKGyRCJU0bKEo=?= "
- + "=?ISO-2022-JP?B?GyRCJTkbKEobJEIkThsoShskQjdoGyhKGyRCRGobKEo=?= "
- + "=?ISO-2022-JP?B?GyRCSEcbKEobJEIkRxsoShskQiQ5GyhKGyRCISobKEo=?=";
+ + "=?ISO-2022-JP?B?GyRCOXAbKEobJEIiKBsoShskQiU1GyhKGyRCJSQbKEo=?= "
+ + "=?ISO-2022-JP?B?GyRCJUkbKEobJEIlUxsoShskQiU4GyhKGyRCJU0bKEo=?= "
+ + "=?ISO-2022-JP?B?GyRCJTkbKEobJEIkThsoShskQjdoGyhKGyRCRGobKEo=?= "
+ + "=?ISO-2022-JP?B?GyRCSEcbKEobJEIkRxsoShskQiQ5GyhKGyRCISobKEo=?=";
String dec = DecoderUtil.decodeEncodedWords(enc);
- assertEquals("\u672A\u627F\u8AFE\u5E83\u544A\u203B\u30B5\u30A4\u30C9\u30D3"
+ Assert.assertEquals("\u672A\u627F\u8AFE\u5E83\u544A\u203B\u30B5\u30A4\u30C9\u30D3"
+ "\u30B8\u30CD\u30B9\u306E\u6C7A\u5B9A\u7248\u3067\u3059\uFF01", dec);
}
- public void testDecodeJapaneseEncodedWordsWithFallback(){
+ @Test
+ public void testDecodeJapaneseEncodedWordsWithFallback() {
String enc = "=?random?B?GyRCTCQbKEobJEI+NRsoShskQkJ6GyhKGyRCOS0bKEo=?= "
+ "=?garbage?B?GyRCOXAbKEobJEIiKBsoShskQiU1GyhKGyRCJSQbKEo=?= "
+ "=?charset?B?GyRCJUkbKEobJEIlUxsoShskQiU4GyhKGyRCJU0bKEo=?= "
+ "=?name?B?GyRCJTkbKEobJEIkThsoShskQjdoGyhKGyRCRGobKEo=?= "
+ "=?trash?B?GyRCSEcbKEobJEIkRxsoShskQiQ5GyhKGyRCISobKEo=?=";
String dec = DecoderUtil.decodeEncodedWords(enc, Charset.forName("ISO-2022-JP"));
- assertEquals("\u672A\u627F\u8AFE\u5E83\u544A\u203B\u30B5\u30A4\u30C9\u30D3"
+ Assert.assertEquals("\u672A\u627F\u8AFE\u5E83\u544A\u203B\u30B5\u30A4\u30C9\u30D3"
+ "\u30B8\u30CD\u30B9\u306E\u6C7A\u5B9A\u7248\u3067\u3059\uFF01", dec);
}
+ @Test
public void testInvalidEncodedWordsAreIgnored() {
- assertEquals("=?iso8859-1?Q?=", DecoderUtil.decodeEncodedWords("=?iso8859-1?Q?="));
- assertEquals("=?iso8859-1?b?=", DecoderUtil.decodeEncodedWords("=?iso8859-1?b?="));
- assertEquals("=?ISO-8859-1?Q?", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?"));
- assertEquals("=?ISO-8859-1?R?abc?=", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?R?abc?="));
- assertEquals("test =?ISO-8859-1?R?abc?=", DecoderUtil.decodeEncodedWords("test =?ISO-8859-1?R?abc?="));
+ Assert.assertEquals("=?iso8859-1?Q?=", DecoderUtil.decodeEncodedWords("=?iso8859-1?Q?="));
+ Assert.assertEquals("=?iso8859-1?b?=", DecoderUtil.decodeEncodedWords("=?iso8859-1?b?="));
+ Assert.assertEquals("=?ISO-8859-1?Q?", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?"));
+ Assert.assertEquals("=?ISO-8859-1?R?abc?=", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?R?abc?="));
+ Assert.assertEquals("test =?ISO-8859-1?R?abc?=", DecoderUtil.decodeEncodedWords("test =?ISO-8859-1?R?abc?="));
}
+ @Test
public void testEmptyEncodedTextIsIgnored() {
// encoded-text requires at least one character according to rfc 2047
- assertEquals("=?ISO-8859-1?Q??=", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q??="));
- assertEquals("=?ISO-8859-1?B??=", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?B??="));
+ Assert.assertEquals("=?ISO-8859-1?Q??=", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q??="));
+ Assert.assertEquals("=?ISO-8859-1?B??=", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?B??="));
}
// see MIME4J-104
+ @Test
public void testWhiteSpaceBetweenEncodedWordsGetsRemoved() {
- assertEquals("a", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?="));
- assertEquals("a b", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= b"));
- assertEquals("ab", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?="));
- assertEquals("ab", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?="));
- assertEquals("ab", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?=\r\n =?ISO-8859-1?Q?b?="));
- assertEquals("a b", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a_b?="));
- assertEquals("a b", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?="));
+ Assert.assertEquals("a", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?="));
+ Assert.assertEquals("a b", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= b"));
+ Assert.assertEquals("ab", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?="));
+ Assert.assertEquals("ab", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?="));
+ Assert.assertEquals("ab", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?=\r\n =?ISO-8859-1?Q?b?="));
+ Assert.assertEquals("a b", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a_b?="));
+ Assert.assertEquals("a b", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?="));
}
// see MIME4J-138
+ @Test
public void testEncodedTextMayStartWithAnEqualsSign() {
- assertEquals(" foo", DecoderUtil.decodeEncodedWords("=?utf-8?Q?=20foo?="));
- assertEquals("Re: How to place a view at the bottom with a 100% width",
- DecoderUtil.decodeEncodedWords("=?utf-8?Q?Re:=20How=20to=20place=20a=20view=20at=20the=20bottom?= "
- + "=?utf-8?Q?=20with=20a=20100%=20width?="));
- assertEquals("Test \u00fc and more",
- DecoderUtil.decodeEncodedWords("Test =?ISO-8859-1?Q?=FC_?= =?ISO-8859-1?Q?and_more?="));
+ Assert.assertEquals(" foo", DecoderUtil.decodeEncodedWords("=?utf-8?Q?=20foo?="));
+ Assert.assertEquals("Re: How to place a view at the bottom with a 100% width",
+ DecoderUtil.decodeEncodedWords("=?utf-8?Q?Re:=20How=20to=20place=20a=20view=20at=20the=20bottom?= "
+ + "=?utf-8?Q?=20with=20a=20100%=20width?="));
+ Assert.assertEquals("Test \u00fc and more",
+ DecoderUtil.decodeEncodedWords("Test =?ISO-8859-1?Q?=FC_?= =?ISO-8859-1?Q?and_more?="));
}
// see MIME4J-142
+ @Test
public void testEncodedTextMayContainDollarSign() {
- assertEquals("variable ${target.nl}", DecoderUtil.decodeEncodedWords("=?utf-8?Q?variable=20${target.nl}?="));
+ Assert.assertEquals("variable ${target.nl}", DecoderUtil.decodeEncodedWords("=?utf-8?Q?variable=20${target.nl}?="));
}
// see MIME4J-209
+ @Test
public void testEncodedTextMayContainQuestionMark() {
- assertEquals("?", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q???="));
+ Assert.assertEquals("?", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q???="));
}
-
+
+ @Test
public void testNonWhiteSpaceBetweenEncodedWordsIsRetained() {
- assertEquals("a b c", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= b =?ISO-8859-1?Q?c?="));
- assertEquals("a\rb\nc", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?=\rb\n=?ISO-8859-1?Q?c?="));
+ Assert.assertEquals("a b c", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?= b =?ISO-8859-1?Q?c?="));
+ Assert.assertEquals("a\rb\nc", DecoderUtil.decodeEncodedWords("=?ISO-8859-1?Q?a?=\rb\n=?ISO-8859-1?Q?c?="));
}
+ @Test
public void testTextBeforeAndAfterEncodedWordIsRetained() {
- assertEquals(" a b c ", DecoderUtil.decodeEncodedWords(" =?ISO-8859-1?Q?a?= b =?ISO-8859-1?Q?c?= "));
- assertEquals("! a b c !", DecoderUtil.decodeEncodedWords("! =?ISO-8859-1?Q?a?= b =?ISO-8859-1?Q?c?= !"));
+ Assert.assertEquals(" a b c ", DecoderUtil.decodeEncodedWords(" =?ISO-8859-1?Q?a?= b =?ISO-8859-1?Q?c?= "));
+ Assert.assertEquals("! a b c !", DecoderUtil.decodeEncodedWords("! =?ISO-8859-1?Q?a?= b =?ISO-8859-1?Q?c?= !"));
}
+ @Test
public void testFunnyInputDoesNotRaiseOutOfMemoryError() {
// Bug detected on June 7, 2005. Decoding the following string caused OutOfMemoryError.
- assertEquals("=3?!!\\=?\"!g6P\"!Xp:\"!", DecoderUtil.decodeEncodedWords("=3?!!\\=?\"!g6P\"!Xp:\"!"));
+ Assert.assertEquals("=3?!!\\=?\"!g6P\"!Xp:\"!", DecoderUtil.decodeEncodedWords("=3?!!\\=?\"!g6P\"!Xp:\"!"));
}
}
View
129 core/src/test/java/org/apache/james/mime4j/codec/EncoderUtilTest.java
@@ -19,151 +19,163 @@
package org.apache.james.mime4j.codec;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
-
-import junit.framework.TestCase;
-
import org.apache.james.mime4j.codec.EncoderUtil.Encoding;
import org.apache.james.mime4j.codec.EncoderUtil.Usage;
import org.apache.james.mime4j.util.CharsetUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
-public class EncoderUtilTest extends TestCase {
+public class EncoderUtilTest {
+ @Test
public void testEncodeAddressDisplayName() throws Exception {
- assertEquals("\"\"", EncoderUtil.encodeAddressDisplayName(""));
- assertEquals("test", EncoderUtil.encodeAddressDisplayName("test"));
- assertEquals(" test ", EncoderUtil.encodeAddressDisplayName(" test "));
- assertEquals(" test\ttest ", EncoderUtil
+ Assert.assertEquals("\"\"", EncoderUtil.encodeAddressDisplayName(""));
+ Assert.assertEquals("test", EncoderUtil.encodeAddressDisplayName("test"));
+ Assert.assertEquals(" test ", EncoderUtil.encodeAddressDisplayName(" test "));
+ Assert.assertEquals(" test\ttest ", EncoderUtil
.encodeAddressDisplayName(" test\ttest "));
- assertEquals("\"test()\"", EncoderUtil
+ Assert.assertEquals("\"test()\"", EncoderUtil
.encodeAddressDisplayName("test()"));
- assertEquals("\"John Q. Public\"", EncoderUtil
+ Assert.assertEquals("\"John Q. Public\"", EncoderUtil
.encodeAddressDisplayName("John Q. Public"));
- assertEquals("\"Giant; \\\"Big\\\" Box\"", EncoderUtil
+ Assert.assertEquals("\"Giant; \\\"Big\\\" Box\"", EncoderUtil
.encodeAddressDisplayName("Giant; \"Big\" Box"));
- assertEquals("=?ISO-8859-1?Q?Semmelbr=F6sel?=", EncoderUtil
+ Assert.assertEquals("=?ISO-8859-1?Q?Semmelbr=F6sel?=", EncoderUtil
.encodeAddressDisplayName("Semmelbr\366sel"));
// dollar sign as to be encoded as =24 when used as a word in a phrase
- assertEquals("=?UTF-8?Q?Dollar_=24_Euro_=E2=82=AC?=", EncoderUtil
+ Assert.assertEquals("=?UTF-8?Q?Dollar_=24_Euro_=E2=82=AC?=", EncoderUtil
.encodeAddressDisplayName("Dollar $ Euro \u20ac"));
}
+ @Test
public void testEncodeAddressLocalPart() throws Exception {
- assertEquals("john.wayne", EncoderUtil
+ Assert.assertEquals("john.wayne", EncoderUtil
.encodeAddressLocalPart("john.wayne"));
- assertEquals("\"clint eastwood\"", EncoderUtil
+ Assert.assertEquals("\"clint eastwood\"", EncoderUtil
.encodeAddressLocalPart("clint eastwood"));
}
+ @Test
public void testEncodeHeaderParameter() throws Exception {
- assertEquals("p=test", EncoderUtil.encodeHeaderParameter("p", "test"));
- assertEquals("p=\"test test\"", EncoderUtil.encodeHeaderParameter("p",
+ Assert.assertEquals("p=test", EncoderUtil.encodeHeaderParameter("p", "test"));
+ Assert.assertEquals("p=\"test test\"", EncoderUtil.encodeHeaderParameter("p",
"test test"));
- assertEquals("p=\"=test\"", EncoderUtil.encodeHeaderParameter("p",
+ Assert.assertEquals("p=\"=test\"", EncoderUtil.encodeHeaderParameter("p",
"=test"));
- assertEquals("p=\"\\\\test\"", EncoderUtil.encodeHeaderParameter("p",
+ Assert.assertEquals("p=\"\\\\test\"", EncoderUtil.encodeHeaderParameter("p",
"\\test"));