You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2008/05/25 11:45:08 UTC

svn commit: r659945 - in /james/mime4j/trunk/src: main/javacc/org/apache/james/mime4j/field/contenttype/ContentTypeParser.jj test/java/org/apache/james/mime4j/message/MessageCompleteMailTest.java

Author: rdonkin
Date: Sun May 25 02:45:07 2008
New Revision: 659945

URL: http://svn.apache.org/viewvc?rev=659945&view=rev
Log:
Confirmed and fixed that content-Type parameter values that contain only digits are ignored MIME4J-41 https://issues.apache.org/jira/browse/MIME4J-41.

Added:
    james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageCompleteMailTest.java
Modified:
    james/mime4j/trunk/src/main/javacc/org/apache/james/mime4j/field/contenttype/ContentTypeParser.jj

Modified: james/mime4j/trunk/src/main/javacc/org/apache/james/mime4j/field/contenttype/ContentTypeParser.jj
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/javacc/org/apache/james/mime4j/field/contenttype/ContentTypeParser.jj?rev=659945&r1=659944&r2=659945&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/javacc/org/apache/james/mime4j/field/contenttype/ContentTypeParser.jj (original)
+++ james/mime4j/trunk/src/main/javacc/org/apache/james/mime4j/field/contenttype/ContentTypeParser.jj Sun May 25 02:45:07 2008
@@ -125,6 +125,7 @@
 {Token t;}
 {
 (	t=<ATOKEN>
+|   t=<DIGITS>
 |	t=<QUOTEDSTRING>
 )
 	{ return t.image; }

Added: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageCompleteMailTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageCompleteMailTest.java?rev=659945&view=auto
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageCompleteMailTest.java (added)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/message/MessageCompleteMailTest.java Sun May 25 02:45:07 2008
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.james.mime4j.message;
+
+import java.io.ByteArrayInputStream;
+
+import org.apache.james.mime4j.ExampleMail;
+
+import junit.framework.TestCase;
+
+public class MessageCompleteMailTest extends TestCase {
+
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+    
+    public void testMultipartMixed() throws Exception {
+        Message message = createMessage(ExampleMail.MIME_MIXED_ALTERNATIVE_BYTES);
+        assertTrue("Should be a multipart/mixed mail", message.isMultipart());
+//        Multipart part = (Multipart)message.getBody();
+//        assertEquals("mixed", part.getSubType());
+    }
+    
+    private Message createMessage(byte[] octets) throws Exception {
+        ByteArrayInputStream in = new ByteArrayInputStream(octets);
+        Message message = new Message(in);
+        return message;
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org