james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1094444 - /james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java
Date Mon, 18 Apr 2011 10:04:04 GMT
Author: olegk
Date: Mon Apr 18 10:04:04 2011
New Revision: 1094444

URL: http://svn.apache.org/viewvc?rev=1094444&view=rev
Log:
MIME4J-194: added unit test

Modified:
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java?rev=1094444&r1=1094443&r2=1094444&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/RawFieldParserTest.java
Mon Apr 18 10:04:04 2011
@@ -248,4 +248,20 @@ public class RawFieldParserTest extends 
         assertEquals("value3", params.get(4).getValue());
     }
 
+    public void testRawBodyParseEmptyParam() {
+        ByteSequence buf = ContentUtil.encode(
+                "multipart/alternative;; boundary=\"boundary\"");
+        RawFieldParser parser = new RawFieldParser();
+        ParserCursor cursor = new ParserCursor(0, buf.length());
+        RawBody body = parser.parseRawBody(buf, cursor);
+        assertNotNull(body);
+        assertEquals("multipart/alternative", body.getValue());
+        List<NameValuePair> params = body.getParams();
+        assertEquals(2, params.size());
+        assertEquals("", params.get(0).getName());
+        assertEquals(null, params.get(0).getValue());
+        assertEquals("boundary", params.get(1).getName());
+        assertEquals("boundary", params.get(1).getValue());
+    }
+
 }
\ No newline at end of file



Mime
View raw message