james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r746223 [2/2] - in /james/mime4j/trunk: examples/src/java/org/apache/james/mime4j/samples/tree/ src/main/java/org/apache/james/mime4j/descriptor/ src/main/java/org/apache/james/mime4j/field/ src/main/java/org/apache/james/mime4j/message/ sr...
Date Fri, 20 Feb 2009 12:28:05 GMT
Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentDispositionFieldTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentDispositionFieldTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentDispositionFieldTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentDispositionFieldTest.java Fri Feb 20 12:28:04 2009
@@ -36,7 +36,7 @@
     public void testDispositionTypeWithSemiColonNoParams() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline;");
         assertEquals("inline", f.getDispositionType());
     }
@@ -44,37 +44,37 @@
     public void testGetDispositionType() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment");
         assertEquals("attachment", f.getDispositionType());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("content-disposition:   InLiNe   ");
         assertEquals("inline", f.getDispositionType());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("CONTENT-DISPOSITION:   x-yada ;" + "  param = yada");
         assertEquals("x-yada", f.getDispositionType());
 
-        f = (ContentDispositionField) Field.parse("CONTENT-DISPOSITION:   ");
+        f = (ContentDispositionField) AbstractField.parse("CONTENT-DISPOSITION:   ");
         assertEquals("", f.getDispositionType());
     }
 
     public void testGetParameter() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("CONTENT-DISPOSITION:   inline ;"
                         + "  filename=yada yada");
         assertEquals("yada", f.getParameter("filename"));
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: x-yada;"
                         + "  fileNAme= \"ya:\\\"*da\"; " + "\tSIZE\t =  1234");
         assertEquals("ya:\"*da", f.getParameter("filename"));
         assertEquals("1234", f.getParameter("size"));
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: x-yada;  "
                         + "fileNAme= \"ya \\\"\\\"\tda \\\"\"; "
                         + "\tx-Yada\t =  \"\\\"hepp\\\"  =us\t-ascii\"");
@@ -85,19 +85,19 @@
     public void testIsDispositionType() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field.parse("Content-Disposition:INline");
+        f = (ContentDispositionField) AbstractField.parse("Content-Disposition:INline");
         assertTrue(f.isDispositionType("InLiNe"));
         assertFalse(f.isDispositionType("NiLiNe"));
         assertTrue(f.isInline());
         assertFalse(f.isAttachment());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment");
         assertTrue(f.isDispositionType("ATTACHMENT"));
         assertFalse(f.isInline());
         assertTrue(f.isAttachment());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: x-something");
         assertTrue(f.isDispositionType("x-SomeThing"));
         assertFalse(f.isInline());
@@ -107,19 +107,19 @@
     public void testGetFilename() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; filename=yada.txt");
         assertEquals("yada.txt", f.getFilename());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; filename=yada yada.txt");
         assertEquals("yada", f.getFilename());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; filename=\"yada yada.txt\"");
         assertEquals("yada yada.txt", f.getFilename());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline");
         assertNull(f.getFilename());
     }
@@ -127,17 +127,17 @@
     public void testGetCreationDate() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; "
                         + "creation-date=\"Tue, 01 Jan 1970 00:00:00 +0000\"");
         assertEquals(new Date(0), f.getCreationDate());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; "
                         + "creation-date=Tue, 01 Jan 1970 00:00:00 +0000");
         assertNull(f.getCreationDate());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment");
         assertNull(f.getCreationDate());
     }
@@ -145,22 +145,22 @@
     public void testGetModificationDate() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; "
                         + "modification-date=\"Tue, 01 Jan 1970 00:00:00 +0000\"");
         assertEquals(new Date(0), f.getModificationDate());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; "
                         + "modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"");
         assertEquals(new Date(855782991000l), f.getModificationDate());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; "
                         + "modification-date=yesterday");
         assertNull(f.getModificationDate());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment");
         assertNull(f.getModificationDate());
     }
@@ -168,16 +168,16 @@
     public void testGetReadDate() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; "
                         + "read-date=\"Tue, 01 Jan 1970 00:00:00 +0000\"");
         assertEquals(new Date(0), f.getReadDate());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: inline; read-date=");
         assertNull(f.getReadDate());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment");
         assertNull(f.getReadDate());
     }
@@ -185,23 +185,23 @@
     public void testGetSize() throws Exception {
         ContentDispositionField f = null;
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment; size=0");
         assertEquals(0, f.getSize());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment; size=matters");
         assertEquals(-1, f.getSize());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment");
         assertEquals(-1, f.getSize());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment; size=-12");
         assertEquals(-1, f.getSize());
 
-        f = (ContentDispositionField) Field
+        f = (ContentDispositionField) AbstractField
                 .parse("Content-Disposition: attachment; size=12");
         assertEquals(12, f.getSize());
     }

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTransferEncodingFieldTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTransferEncodingFieldTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTransferEncodingFieldTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTransferEncodingFieldTest.java Fri Feb 20 12:28:04 2009
@@ -20,7 +20,7 @@
 package org.apache.james.mime4j.field;
 
 import org.apache.james.mime4j.field.ContentTransferEncodingField;
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
 
 import junit.framework.TestCase;
 
@@ -30,19 +30,19 @@
         ContentTransferEncodingField f = null;
         
         f = (ContentTransferEncodingField) 
-                    Field.parse("Content-Transfer-Encoding: 8bit");
+                    AbstractField.parse("Content-Transfer-Encoding: 8bit");
         assertEquals("8bit", f.getEncoding());
         
         f = (ContentTransferEncodingField) 
-                    Field.parse("Content-Transfer-Encoding:    BaSE64   ");
+                    AbstractField.parse("Content-Transfer-Encoding:    BaSE64   ");
         assertEquals("base64", f.getEncoding());
         
         f = (ContentTransferEncodingField) 
-                    Field.parse("Content-Transfer-Encoding:       ");
+                    AbstractField.parse("Content-Transfer-Encoding:       ");
         assertEquals("", f.getEncoding());
         
         f = (ContentTransferEncodingField) 
-                    Field.parse("Content-Transfer-Encoding:");
+                    AbstractField.parse("Content-Transfer-Encoding:");
         assertEquals("", f.getEncoding());
     }
     
@@ -50,18 +50,18 @@
         ContentTransferEncodingField f = null;
         
         f = (ContentTransferEncodingField) 
-                    Field.parse("Content-Transfer-Encoding: 8bit");
+                    AbstractField.parse("Content-Transfer-Encoding: 8bit");
         assertEquals("8bit", ContentTransferEncodingField.getEncoding(f));
         
         f = null;
         assertEquals("7bit", ContentTransferEncodingField.getEncoding(f));
         
         f = (ContentTransferEncodingField) 
-                    Field.parse("Content-Transfer-Encoding:       ");
+                    AbstractField.parse("Content-Transfer-Encoding:       ");
         assertEquals("7bit", ContentTransferEncodingField.getEncoding(f));
         
         f = (ContentTransferEncodingField) 
-                    Field.parse("Content-Transfer-Encoding:");
+                    AbstractField.parse("Content-Transfer-Encoding:");
         assertEquals("7bit", ContentTransferEncodingField.getEncoding(f));
     }
 

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTypeFieldTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTypeFieldTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTypeFieldTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/ContentTypeFieldTest.java Fri Feb 20 12:28:04 2009
@@ -20,7 +20,7 @@
 package org.apache.james.mime4j.field;
 
 import org.apache.james.mime4j.field.ContentTypeField;
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
 import org.apache.log4j.BasicConfigurator;
 
 import junit.framework.TestCase;
@@ -36,24 +36,24 @@
     public void testMimeTypeWithSemiColonNoParams() throws Exception  {
         ContentTypeField f = null;
         
-        f = (ContentTypeField) Field.parse("Content-Type: text/html;");
+        f = (ContentTypeField) AbstractField.parse("Content-Type: text/html;");
         assertEquals("text/html", f.getMimeType());
     }
     
     public void testGetMimeType() throws Exception {
         ContentTypeField f = null;
         
-        f = (ContentTypeField) Field.parse("Content-Type: text/PLAIN");
+        f = (ContentTypeField) AbstractField.parse("Content-Type: text/PLAIN");
         assertEquals("text/plain", f.getMimeType());
         
-        f = (ContentTypeField) Field.parse("content-type:   TeXt / html   ");
+        f = (ContentTypeField) AbstractField.parse("content-type:   TeXt / html   ");
         assertEquals("text/html", f.getMimeType());
         
-        f = (ContentTypeField) Field.parse("CONTENT-TYPE:   x-app/yada ;"
+        f = (ContentTypeField) AbstractField.parse("CONTENT-TYPE:   x-app/yada ;"
                                                     + "  param = yada");
         assertEquals("x-app/yada", f.getMimeType());
         
-        f = (ContentTypeField) Field.parse("CONTENT-TYPE:   yada");
+        f = (ContentTypeField) AbstractField.parse("CONTENT-TYPE:   yada");
         assertEquals("", f.getMimeType());
     }
     
@@ -61,47 +61,47 @@
         ContentTypeField child = null;
         ContentTypeField parent = null;
         
-        child = (ContentTypeField) Field.parse("Content-Type: child/type");
-        parent = (ContentTypeField) Field.parse("Content-Type: parent/type");
+        child = (ContentTypeField) AbstractField.parse("Content-Type: child/type");
+        parent = (ContentTypeField) AbstractField.parse("Content-Type: parent/type");
         assertEquals("child/type", ContentTypeField.getMimeType(child, parent));
         
         child = null;
-        parent = (ContentTypeField) Field.parse("Content-Type: parent/type");
+        parent = (ContentTypeField) AbstractField.parse("Content-Type: parent/type");
         assertEquals("text/plain", ContentTypeField.getMimeType(child, parent));
-        parent = (ContentTypeField) Field.parse("Content-Type: multipart/digest");
+        parent = (ContentTypeField) AbstractField.parse("Content-Type: multipart/digest");
         assertEquals("message/rfc822", ContentTypeField.getMimeType(child, parent));
         
-        child = (ContentTypeField) Field.parse("Content-Type:");
-        parent = (ContentTypeField) Field.parse("Content-Type: parent/type");
+        child = (ContentTypeField) AbstractField.parse("Content-Type:");
+        parent = (ContentTypeField) AbstractField.parse("Content-Type: parent/type");
         assertEquals("text/plain", ContentTypeField.getMimeType(child, parent));
-        parent = (ContentTypeField) Field.parse("Content-Type: multipart/digest");
+        parent = (ContentTypeField) AbstractField.parse("Content-Type: multipart/digest");
         assertEquals("message/rfc822", ContentTypeField.getMimeType(child, parent));
     }
     
     public void testGetCharsetStatic() throws Exception {
         ContentTypeField f = null;
         
-        f = (ContentTypeField) Field.parse("Content-Type: some/type; charset=iso8859-1");
+        f = (ContentTypeField) AbstractField.parse("Content-Type: some/type; charset=iso8859-1");
         assertEquals("iso8859-1", ContentTypeField.getCharset(f));
         
-        f = (ContentTypeField) Field.parse("Content-Type: some/type;");
+        f = (ContentTypeField) AbstractField.parse("Content-Type: some/type;");
         assertEquals("us-ascii", ContentTypeField.getCharset(f));
     }
     
     public void testGetParameter() throws Exception {
         ContentTypeField f = null;
         
-        f = (ContentTypeField) Field.parse("CONTENT-TYPE:   text / html ;"
+        f = (ContentTypeField) AbstractField.parse("CONTENT-TYPE:   text / html ;"
                                                 + "  boundary=yada yada");
         assertEquals("yada", f.getParameter("boundary"));
         
-        f = (ContentTypeField) Field.parse("Content-Type: x-app/yada;"
+        f = (ContentTypeField) AbstractField.parse("Content-Type: x-app/yada;"
                                                 + "  boUNdarY= \"ya:\\\"*da\"; "
                                                 + "\tcharset\t =  us-ascii");
         assertEquals("ya:\"*da", f.getParameter("boundary"));
         assertEquals("us-ascii", f.getParameter("charset"));
         
-        f = (ContentTypeField) Field.parse("Content-Type: x-app/yada;  "
+        f = (ContentTypeField) AbstractField.parse("Content-Type: x-app/yada;  "
                             + "boUNdarY= \"ya \\\"\\\"\tda \\\"\"; "
                             + "\tcharset\t =  \"\\\"hepp\\\"  =us\t-ascii\"");
         assertEquals("ya \"\"\tda \"", f.getParameter("boundary"));

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldTest.java Fri Feb 20 12:28:04 2009
@@ -22,8 +22,9 @@
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.field.ContentTransferEncodingField;
 import org.apache.james.mime4j.field.ContentTypeField;
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
 import org.apache.james.mime4j.field.UnstructuredField;
+import org.apache.james.mime4j.parser.Field;
 
 import junit.framework.TestCase;
 
@@ -32,14 +33,14 @@
     public void testGetName() throws Exception {
         Field f = null;
         
-        f = Field.parse("Subject: Yada yada yada");
+        f = AbstractField.parse("Subject: Yada yada yada");
         assertEquals("Testing simple field", "Subject", f.getName());
         
-        f = Field.parse("X-yada-yada: Yada yada yada");
+        f = AbstractField.parse("X-yada-yada: Yada yada yada");
         assertEquals("Testing an X- field", "X-yada-yada", f.getName());
         
         try {
-            f = Field.parse("Yada yada yada");
+            f = AbstractField.parse("Yada yada yada");
             fail("MimeException not thrown when using an invalid field");
         } catch (MimeException e) {
         }
@@ -48,13 +49,13 @@
     public void testParse() throws Exception {
         Field f = null;
         
-        f = Field.parse("Subject: Yada yada yada");
+        f = AbstractField.parse("Subject: Yada yada yada");
         assertTrue("Field should be UnstructuredField", 
                         f instanceof UnstructuredField);
-        f = Field.parse("Content-Type: text/plain");
+        f = AbstractField.parse("Content-Type: text/plain");
         assertTrue("Field should be ContentTypeField", 
                         f instanceof ContentTypeField);
-        f = Field.parse("Content-Transfer-Encoding: 7bit");
+        f = AbstractField.parse("Content-Transfer-Encoding: 7bit");
         assertTrue("Field should be ContentTransferEncodingField", 
                         f instanceof ContentTransferEncodingField);
     }

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldsTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldsTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldsTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/FieldsTest.java Fri Feb 20 12:28:04 2009
@@ -200,7 +200,7 @@
     }
 
     public void testMessageId() throws Exception {
-        Field messageId = Fields.messageId("acme.org");
+        AbstractField messageId = Fields.messageId("acme.org");
 
         String raw = messageId.getRaw();
         assertTrue(raw.startsWith("Message-ID: <Mime4j."));

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java Fri Feb 20 12:28:04 2009
@@ -19,7 +19,7 @@
 
 package org.apache.james.mime4j.field;
 
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
 import org.apache.james.mime4j.field.UnstructuredField;
 
 import junit.framework.TestCase;
@@ -29,13 +29,13 @@
     public void testGetBody() throws Exception {
         UnstructuredField f = null;
         
-        f = (UnstructuredField) Field.parse("Subject: Yada\r\n yada yada\r\n");
+        f = (UnstructuredField) AbstractField.parse("Subject: Yada\r\n yada yada\r\n");
         assertEquals("Testing folding value 1", "Yada yada yada", f.getValue());
         
-        f = (UnstructuredField) Field.parse("Subject:  \r\n\tyada");
+        f = (UnstructuredField) AbstractField.parse("Subject:  \r\n\tyada");
         assertEquals("Testing folding value 2", " \tyada", f.getValue());
         
-        f = (UnstructuredField) Field.parse("Subject:yada");
+        f = (UnstructuredField) AbstractField.parse("Subject:yada");
         assertEquals("Testing value without a leading ' '", "yada", f.getValue());
     }
 

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/CopyConstructorTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/CopyConstructorTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/CopyConstructorTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/CopyConstructorTest.java Fri Feb 20 12:28:04 2009
@@ -22,7 +22,8 @@
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
+import org.apache.james.mime4j.parser.Field;
 
 import junit.framework.TestCase;
 
@@ -160,9 +161,9 @@
     }
 
     public void testCopyHeader() throws Exception {
-        Field f1 = Field.parse("name1: value1");
-        Field f2 = Field.parse("name2: value");
-        Field f3 = Field.parse("name1: value2");
+        Field f1 = AbstractField.parse("name1: value1");
+        Field f2 = AbstractField.parse("name2: value");
+        Field f3 = AbstractField.parse("name1: value2");
 
         Header original = new Header();
         original.addField(f1);

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/EntityTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/EntityTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/EntityTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/EntityTest.java Fri Feb 20 12:28:04 2009
@@ -19,7 +19,7 @@
 
 package org.apache.james.mime4j.message;
 
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
 import org.apache.james.mime4j.message.Entity;
 
 import junit.framework.TestCase;
@@ -32,7 +32,7 @@
         assertNull(entity.getDispositionType());
 
         Header header = new Header();
-        header.setField(Field.parse("Content-Disposition", "inline"));
+        header.setField(AbstractField.parse("Content-Disposition", "inline"));
         entity.setHeader(header);
 
         assertEquals("inline", entity.getDispositionType());
@@ -62,7 +62,7 @@
         assertNull(entity.getFilename());
 
         Header header = new Header();
-        header.setField(Field.parse("Content-Disposition",
+        header.setField(AbstractField.parse("Content-Disposition",
                 "attachment; filename=\"some file.dat\""));
         entity.setHeader(header);
 

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/HeaderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/HeaderTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/HeaderTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/HeaderTest.java Fri Feb 20 12:28:04 2009
@@ -23,7 +23,8 @@
 
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.james.mime4j.MimeIOException;
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
+import org.apache.james.mime4j.parser.Field;
 import org.apache.james.mime4j.util.CharsetUtil;
 
 public class HeaderTest extends TestCase {
@@ -34,8 +35,8 @@
 
     public void testHeader() throws Exception {
         Header header = new Header();
-        header.addField(Field.parse(SUBJECT));
-        header.addField(Field.parse(TO));
+        header.addField(AbstractField.parse(SUBJECT));
+        header.addField(AbstractField.parse(TO));
 
         assertNotNull("Subject found", header.getField("Subject"));
         assertNotNull("To found", header.getField("To"));
@@ -49,7 +50,7 @@
     public void testWriteInStrictMode() throws Exception {
         String hello = SWISS_GERMAN_HELLO;
         Header header = new Header();
-        header.addField(Field.parse("Hello: " + hello));
+        header.addField(AbstractField.parse("Hello: " + hello));
         
         Field field = header.getField("Hello");
         assertNotNull(field);
@@ -74,8 +75,8 @@
     public void testWriteInLenientMode() throws Exception {
         String hello = SWISS_GERMAN_HELLO;
         Header header = new Header();
-        header.addField(Field.parse("Hello: " + hello));
-        header.addField(Field.parse("Content-type: text/plain; charset=" + 
+        header.addField(AbstractField.parse("Hello: " + hello));
+        header.addField(AbstractField.parse("Content-type: text/plain; charset=" + 
                 CharsetUtil.ISO_8859_1.name()));
         
         Field field = header.getField("Hello");
@@ -93,9 +94,9 @@
     
     public void testRemoveFields() throws Exception {
         Header header = new Header();
-        header.addField(Field.parse("Received: from foo by bar for james"));
-        header.addField(Field.parse("Content-type: text/plain; charset=US-ASCII"));
-        header.addField(Field.parse("ReCeIvEd: from bar by foo for james"));
+        header.addField(AbstractField.parse("Received: from foo by bar for james"));
+        header.addField(AbstractField.parse("Content-type: text/plain; charset=US-ASCII"));
+        header.addField(AbstractField.parse("ReCeIvEd: from bar by foo for james"));
 
         assertEquals(3, header.getFields().size());
         assertEquals(2, header.getFields("received").size());
@@ -112,9 +113,9 @@
 
     public void testRemoveNonExistantField() throws Exception {
         Header header = new Header();
-        header.addField(Field.parse("Received: from foo by bar for james"));
-        header.addField(Field.parse("Content-type: text/plain; charset=US-ASCII"));
-        header.addField(Field.parse("ReCeIvEd: from bar by foo for james"));
+        header.addField(AbstractField.parse("Received: from foo by bar for james"));
+        header.addField(AbstractField.parse("Content-type: text/plain; charset=US-ASCII"));
+        header.addField(AbstractField.parse("ReCeIvEd: from bar by foo for james"));
 
         assertEquals(0, header.removeFields("noSuchField"));
 
@@ -125,12 +126,12 @@
 
     public void testSetField() throws Exception {
         Header header = new Header();
-        header.addField(Field.parse("From: mime4j@james.apache.org"));
-        header.addField(Field.parse("Received: from foo by bar for james"));
-        header.addField(Field.parse("Content-type: text/plain; charset=US-ASCII"));
-        header.addField(Field.parse("ReCeIvEd: from bar by foo for james"));
+        header.addField(AbstractField.parse("From: mime4j@james.apache.org"));
+        header.addField(AbstractField.parse("Received: from foo by bar for james"));
+        header.addField(AbstractField.parse("Content-type: text/plain; charset=US-ASCII"));
+        header.addField(AbstractField.parse("ReCeIvEd: from bar by foo for james"));
 
-        header.setField(Field.parse("received: from nobody by noone for james"));
+        header.setField(AbstractField.parse("received: from nobody by noone for james"));
 
         assertEquals(3, header.getFields().size());
         assertEquals(1, header.getFields("received").size());
@@ -142,11 +143,11 @@
 
     public void testSetNonExistantField() throws Exception {
         Header header = new Header();
-        header.addField(Field.parse("Received: from foo by bar for james"));
-        header.addField(Field.parse("Content-type: text/plain; charset=US-ASCII"));
-        header.addField(Field.parse("ReCeIvEd: from bar by foo for james"));
+        header.addField(AbstractField.parse("Received: from foo by bar for james"));
+        header.addField(AbstractField.parse("Content-type: text/plain; charset=US-ASCII"));
+        header.addField(AbstractField.parse("ReCeIvEd: from bar by foo for james"));
 
-        header.setField(Field.parse("Message-ID: <msg9901@apache.org>"));
+        header.setField(AbstractField.parse("Message-ID: <msg9901@apache.org>"));
 
         assertEquals(4, header.getFields().size());
         assertEquals(1, header.getFields("message-id").size());

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageParserTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageParserTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageParserTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageParserTest.java Fri Feb 20 12:28:04 2009
@@ -20,7 +20,7 @@
 package org.apache.james.mime4j.message;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.parser.Field;
 import org.apache.james.mime4j.parser.MimeEntityConfig;
 import org.apache.james.mime4j.util.CharsetUtil;
 import org.apache.log4j.BasicConfigurator;

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageTest.java Fri Feb 20 12:28:04 2009
@@ -34,7 +34,7 @@
 import junit.framework.TestCase;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
 import org.apache.james.mime4j.field.address.Group;
 import org.apache.james.mime4j.field.address.Mailbox;
 
@@ -54,13 +54,13 @@
         headerMultipartDigest = new Header();
         
         headerTextPlain.addField(
-                Field.parse("Content-Type: text/plain"));
+                AbstractField.parse("Content-Type: text/plain"));
         headerMessageRFC822.addField(
-                Field.parse("Content-Type: message/RFC822"));
+                AbstractField.parse("Content-Type: message/RFC822"));
         headerMultipartMixed.addField(
-                Field.parse("Content-Type: multipart/mixed; boundary=foo"));
+                AbstractField.parse("Content-Type: multipart/mixed; boundary=foo"));
         headerMultipartDigest.addField(
-                Field.parse("Content-Type: multipart/digest; boundary=foo"));
+                AbstractField.parse("Content-Type: multipart/digest; boundary=foo"));
     }
 
     public void testGetMimeType() {
@@ -147,7 +147,7 @@
         byte[] inputByte = getRawMessageAsByteArray();
 
         Message m = new Message(new ByteArrayInputStream(inputByte));
-        m.getHeader().addField(Field.parse(testheader));
+        m.getHeader().addField(AbstractField.parse(testheader));
 
         assertEquals("header added", m.getHeader().getField(headerName)
                 .getBody(), headerValue);
@@ -167,7 +167,7 @@
 
         String id = "<msg17@localhost>";
         Header header = new Header();
-        header.setField(Field.parse("Message-ID", id));
+        header.setField(AbstractField.parse("Message-ID", id));
         m.setHeader(header);
         assertEquals(id, m.getMessageId());
     }
@@ -188,11 +188,11 @@
 
         String subject = "testing 1 2";
         Header header = new Header();
-        header.setField(Field.parse("Subject", subject));
+        header.setField(AbstractField.parse("Subject", subject));
         m.setHeader(header);
         assertEquals(subject, m.getSubject());
 
-        header.setField(Field.parse("Subject", "=?windows-1252?Q?99_=80?="));
+        header.setField(AbstractField.parse("Subject", "=?windows-1252?Q?99_=80?="));
         assertEquals("99 \u20ac", m.getSubject());
     }
 
@@ -213,7 +213,7 @@
         assertNull(m.getDate());
 
         Header header = new Header();
-        header.setField(Field.parse("Date", "Thu, 1 Jan 1970 05:30:00 +0530"));
+        header.setField(AbstractField.parse("Date", "Thu, 1 Jan 1970 05:30:00 +0530"));
         m.setHeader(header);
 
         assertEquals(new Date(0), m.getDate());
@@ -236,7 +236,7 @@
         assertNull(m.getSender());
 
         Header header = new Header();
-        header.setField(Field.parse("Sender", "john.doe@example.net"));
+        header.setField(AbstractField.parse("Sender", "john.doe@example.net"));
         m.setHeader(header);
 
         assertEquals("john.doe@example.net", m.getSender().getAddress());
@@ -258,7 +258,7 @@
         assertNull(m.getFrom());
 
         Header header = new Header();
-        header.setField(Field.parse("From", "john.doe@example.net"));
+        header.setField(AbstractField.parse("From", "john.doe@example.net"));
         m.setHeader(header);
 
         assertEquals("john.doe@example.net", m.getFrom().get(0).getAddress());
@@ -291,7 +291,7 @@
         assertNull(m.getTo());
 
         Header header = new Header();
-        header.setField(Field.parse("To", "john.doe@example.net"));
+        header.setField(AbstractField.parse("To", "john.doe@example.net"));
         m.setHeader(header);
 
         assertEquals("john.doe@example.net", ((Mailbox) m.getTo().get(0))
@@ -329,7 +329,7 @@
         assertNull(m.getCc());
 
         Header header = new Header();
-        header.setField(Field.parse("Cc", "john.doe@example.net"));
+        header.setField(AbstractField.parse("Cc", "john.doe@example.net"));
         m.setHeader(header);
 
         assertEquals("john.doe@example.net", ((Mailbox) m.getCc().get(0))
@@ -367,7 +367,7 @@
         assertNull(m.getBcc());
 
         Header header = new Header();
-        header.setField(Field.parse("Bcc", "john.doe@example.net"));
+        header.setField(AbstractField.parse("Bcc", "john.doe@example.net"));
         m.setHeader(header);
 
         assertEquals("john.doe@example.net", ((Mailbox) m.getBcc().get(0))
@@ -405,7 +405,7 @@
         assertNull(m.getReplyTo());
 
         Header header = new Header();
-        header.setField(Field.parse("Reply-To", "john.doe@example.net"));
+        header.setField(AbstractField.parse("Reply-To", "john.doe@example.net"));
         m.setHeader(header);
 
         assertEquals("john.doe@example.net", ((Mailbox) m.getReplyTo().get(0))

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MultipartFormTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MultipartFormTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MultipartFormTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MultipartFormTest.java Fri Feb 20 12:28:04 2009
@@ -23,7 +23,7 @@
 
 import junit.framework.TestCase;
 
-import org.apache.james.mime4j.field.Field;
+import org.apache.james.mime4j.field.AbstractField;
 
 public class MultipartFormTest extends TestCase {
 
@@ -33,24 +33,24 @@
         Message message = new Message();
         Header header = new Header();
         header.addField(
-                Field.parse("Content-Type: multipart/form-data; boundary=foo"));
+                AbstractField.parse("Content-Type: multipart/form-data; boundary=foo"));
         message.setHeader(header);
         
         Multipart multipart = new Multipart("alternative");
         multipart.setParent(message);
         BodyPart p1 = new BodyPart();
         Header h1 = new Header();
-        h1.addField(Field.parse("Content-Type: text/plain"));
+        h1.addField(AbstractField.parse("Content-Type: text/plain"));
         p1.setHeader(h1);
         p1.setBody(bodyFactory.textBody("this stuff"));
         BodyPart p2 = new BodyPart();
         Header h2 = new Header();
-        h2.addField(Field.parse("Content-Type: text/plain"));
+        h2.addField(AbstractField.parse("Content-Type: text/plain"));
         p2.setHeader(h2);
         p2.setBody(bodyFactory.textBody("that stuff"));
         BodyPart p3 = new BodyPart();
         Header h3 = new Header();
-        h3.addField(Field.parse("Content-Type: text/plain"));
+        h3.addField(AbstractField.parse("Content-Type: text/plain"));
         p3.setHeader(h3);
         p3.setBody(bodyFactory.textBody("all kind of stuff"));
 

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java Fri Feb 20 12:28:04 2009
@@ -63,33 +63,33 @@
         assertEquals(EntityStates.T_START_HEADER, entity.getState());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("To", entity.getFieldName());
-        assertEquals(" Road Runner <runner@example.org>", entity.getFieldValue());
+        assertEquals("To", entity.getField().getName());
+        assertEquals(" Road Runner <runner@example.org>", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("From", entity.getFieldName());
-        assertEquals(" Wile E. Cayote <wile@example.org>", entity.getFieldValue());
+        assertEquals("From", entity.getField().getName());
+        assertEquals(" Wile E. Cayote <wile@example.org>", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Date", entity.getFieldName());
-        assertEquals(" Tue, 12 Feb 2008 17:34:09 +0000 (GMT)", entity.getFieldValue());
+        assertEquals("Date", entity.getField().getName());
+        assertEquals(" Tue, 12 Feb 2008 17:34:09 +0000 (GMT)", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Subject", entity.getFieldName());
-        assertEquals(" Mail", entity.getFieldValue());
+        assertEquals("Subject", entity.getField().getName());
+        assertEquals(" Mail", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Content-Type", entity.getFieldName());
-        assertEquals(" text/plain", entity.getFieldValue());
+        assertEquals("Content-Type", entity.getField().getName());
+        assertEquals(" text/plain", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_END_HEADER, entity.getState());
         try {
-            entity.getFieldName();
+            entity.getField().getName();
             fail("IllegalStateException should have been thrown");
         } catch (IllegalStateException expected) {
         }
         try {
-            entity.getFieldValue();
+            entity.getField().getBody();
             fail("IllegalStateException should have been thrown");
         } catch (IllegalStateException expected) {
         }
@@ -149,24 +149,24 @@
         assertEquals(EntityStates.T_START_HEADER, entity.getState());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("To", entity.getFieldName());
-        assertEquals(" Road Runner <runner@example.org>", entity.getFieldValue());
+        assertEquals("To", entity.getField().getName());
+        assertEquals(" Road Runner <runner@example.org>", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("From", entity.getFieldName());
-        assertEquals(" Wile E. Cayote <wile@example.org>", entity.getFieldValue());
+        assertEquals("From", entity.getField().getName());
+        assertEquals(" Wile E. Cayote <wile@example.org>", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Date", entity.getFieldName());
-        assertEquals(" Tue, 12 Feb 2008 17:34:09 +0000 (GMT)", entity.getFieldValue());
+        assertEquals("Date", entity.getField().getName());
+        assertEquals(" Tue, 12 Feb 2008 17:34:09 +0000 (GMT)", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Subject", entity.getFieldName());
-        assertEquals(" Mail", entity.getFieldValue());
+        assertEquals("Subject", entity.getField().getName());
+        assertEquals(" Mail", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Content-Type", entity.getFieldName());
-        assertEquals(" multipart/mixed;boundary=1729", entity.getFieldValue());
+        assertEquals("Content-Type", entity.getField().getName());
+        assertEquals(" multipart/mixed;boundary=1729", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_END_HEADER, entity.getState());
         entity.advance();
@@ -183,8 +183,8 @@
         assertEquals(EntityStates.T_START_HEADER, p1.getState());
         p1.advance();
         assertEquals(EntityStates.T_FIELD, p1.getState());
-        assertEquals("Content-Type", p1.getFieldName());
-        assertEquals(" text/plain; charset=US-ASCII", p1.getFieldValue());
+        assertEquals("Content-Type", p1.getField().getName());
+        assertEquals(" text/plain; charset=US-ASCII", p1.getField().getBody());
         p1.advance();
         assertEquals(EntityStates.T_END_HEADER, p1.getState());
         p1.advance();
@@ -203,8 +203,8 @@
         assertEquals(EntityStates.T_START_HEADER, p2.getState());
         p2.advance();
         assertEquals(EntityStates.T_FIELD, p2.getState());
-        assertEquals("Content-Type", p2.getFieldName());
-        assertEquals(" text/plain; charset=US-ASCII", p2.getFieldValue());
+        assertEquals("Content-Type", p2.getField().getName());
+        assertEquals(" text/plain; charset=US-ASCII", p2.getField().getBody());
         p2.advance();
         assertEquals(EntityStates.T_END_HEADER, p2.getState());
         p2.advance();
@@ -264,24 +264,24 @@
         assertEquals(EntityStates.T_START_HEADER, entity.getState());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("To", entity.getFieldName());
-        assertEquals(" Road Runner <runner@example.org>", entity.getFieldValue());
+        assertEquals("To", entity.getField().getName());
+        assertEquals(" Road Runner <runner@example.org>", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("From", entity.getFieldName());
-        assertEquals(" Wile E. Cayote <wile@example.org>", entity.getFieldValue());
+        assertEquals("From", entity.getField().getName());
+        assertEquals(" Wile E. Cayote <wile@example.org>", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Date", entity.getFieldName());
-        assertEquals(" Tue, 12 Feb 2008 17:34:09 +0000 (GMT)", entity.getFieldValue());
+        assertEquals("Date", entity.getField().getName());
+        assertEquals(" Tue, 12 Feb 2008 17:34:09 +0000 (GMT)", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Subject", entity.getFieldName());
-        assertEquals(" Mail", entity.getFieldValue());
+        assertEquals("Subject", entity.getField().getName());
+        assertEquals(" Mail", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        assertEquals("Content-Type", entity.getFieldName());
-        assertEquals(" multipart/mixed;boundary=1729", entity.getFieldValue());
+        assertEquals("Content-Type", entity.getField().getName());
+        assertEquals(" multipart/mixed;boundary=1729", entity.getField().getBody());
         entity.advance();
         assertEquals(EntityStates.T_END_HEADER, entity.getState());
         entity.advance();
@@ -297,8 +297,6 @@
         assertEquals(EntityStates.T_RAW_ENTITY, p1.getState());
         assertNull(p1.getBodyDescriptor());
         assertNull(p1.getField());
-        assertNull(p1.getFieldName());
-        assertNull(p1.getFieldValue());
         assertEquals(
                 "Content-Type: text/plain; charset=US-ASCII\r\n" +
                 "\r\n" +
@@ -312,8 +310,6 @@
         assertEquals(EntityStates.T_RAW_ENTITY, p2.getState());
         assertNull(p2.getBodyDescriptor());
         assertNull(p2.getField());
-        assertNull(p2.getFieldName());
-        assertNull(p2.getFieldValue());
         assertEquals(
                 "Content-Type: text/plain; charset=US-ASCII\r\n" +
                 "\r\n" +

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java Fri Feb 20 12:28:04 2009
@@ -139,8 +139,8 @@
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
-                assertEquals(expected.removeFirst(), fieldData);
+            public void field(Field field) {
+                assertEquals(expected.removeFirst(), field.getRaw());
             }
         });
         
@@ -163,8 +163,8 @@
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
-                assertEquals(expected.removeFirst(), fieldData);
+            public void field(Field field) {
+                assertEquals(expected.removeFirst(), field.getRaw());
             }
         });
         
@@ -187,8 +187,8 @@
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
-                assertEquals(expected.removeFirst(), fieldData);
+            public void field(Field field) {
+                assertEquals(expected.removeFirst(), field.getRaw());
             }
         });
         
@@ -248,8 +248,8 @@
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
-                assertEquals(expected.removeFirst(), fieldData);
+            public void field(Field field) {
+                assertEquals(expected.removeFirst(), field.getRaw());
             }
         });
         
@@ -297,7 +297,7 @@
             }
 
             @Override
-            public void field(String fieldData) {
+            public void field(Field field) {
                 fail("field shouldn't be called for empty stream");
             }
 
@@ -340,7 +340,7 @@
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
+            public void field(Field field) {
                 fail("No fields should be reported");
             }
             @Override
@@ -371,8 +371,8 @@
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
-                assertEquals(expected.removeFirst(), fieldData);
+            public void field(Field field) {
+                assertEquals(expected.removeFirst(), field.getRaw());
             }
             @Override
             public void body(BodyDescriptor bd, InputStream is) throws IOException {
@@ -399,8 +399,8 @@
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
-                assertEquals(expected.removeFirst(), fieldData);
+            public void field(Field field) {
+                assertEquals(expected.removeFirst(), field.getRaw());
             }
         });
         
@@ -418,8 +418,8 @@
         parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(String fieldData) {
-                assertEquals(expected.removeFirst(), fieldData);
+            public void field(Field field) {
+                assertEquals(expected.removeFirst(), field.getRaw());
             }
         });
         

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/TestHandler.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/TestHandler.java?rev=746223&r1=746222&r2=746223&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/TestHandler.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/parser/TestHandler.java Fri Feb 20 12:28:04 2009
@@ -90,8 +90,8 @@
     public void startHeader() {
         sb.append("<header>\r\n");
     }
-    public void field(String fieldData) {
-        sb.append("<field>\r\n" + escape(fieldData) + "</field>\r\n");
+    public void field(Field field) {
+        sb.append("<field>\r\n" + escape(field.getRaw()) + "</field>\r\n");
     }
     public void endHeader() {
         sb.append("</header>\r\n");



Mime
View raw message