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 ba...@apache.org on 2006/03/25 18:57:38 UTC
svn commit: r388789 - in /james/server/trunk/src:
java/org/apache/james/transport/mailets/AddFooter.java
test/org/apache/james/transport/mailets/AddFooterTest.java
Author: bago
Date: Sat Mar 25 09:57:36 2006
New Revision: 388789
URL: http://svn.apache.org/viewcvs?rev=388789&view=rev
Log:
AddFooter mailet throw UnsupportedEncodingException (JAMES-455)
Added a test to AddFooterTest.
Modified:
james/server/trunk/src/java/org/apache/james/transport/mailets/AddFooter.java
james/server/trunk/src/test/org/apache/james/transport/mailets/AddFooterTest.java
Modified: james/server/trunk/src/java/org/apache/james/transport/mailets/AddFooter.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/transport/mailets/AddFooter.java?rev=388789&r1=388788&r2=388789&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/transport/mailets/AddFooter.java (original)
+++ james/server/trunk/src/java/org/apache/james/transport/mailets/AddFooter.java Sat Mar 25 09:57:36 2006
@@ -28,6 +28,7 @@
import javax.mail.internet.MimePart;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.util.StringTokenizer;
/**
@@ -94,6 +95,8 @@
} else {
log("Unable to add footer to mail " + mail.getName());
}
+ } catch (UnsupportedEncodingException e) {
+ log("UnsupportedEncoding Unable to add footer to mail " + mail.getName());
} catch (IOException ioe) {
throw new MessagingException("Could not read message", ioe);
}
Modified: james/server/trunk/src/test/org/apache/james/transport/mailets/AddFooterTest.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/test/org/apache/james/transport/mailets/AddFooterTest.java?rev=388789&r1=388788&r2=388789&view=diff
==============================================================================
--- james/server/trunk/src/test/org/apache/james/transport/mailets/AddFooterTest.java (original)
+++ james/server/trunk/src/test/org/apache/james/transport/mailets/AddFooterTest.java Sat Mar 25 09:57:36 2006
@@ -102,6 +102,23 @@
}
+ public void testUnsupportedEncoding() throws MessagingException, IOException {
+
+ // quoted printable mimemessage text/plain
+ String asciisource = "Subject: test\r\nContent-Type: text/plain; charset=UNSUPPORTED_ENCODING\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\nTest=E0 and one\r\n";
+
+ String footer = "------ my footer \u00E0/\u20AC ------";
+
+ try {
+ String res = processAddFooter(asciisource, footer);
+ assertEquals(asciisource, res);
+ } catch (Exception e) {
+ fail("should not throw an exception: "+e.getMessage());
+ }
+
+
+ }
+
/*
* Test for JAMES-443
* This should not add the header and should leave the multipart/mixed Content-Type intact
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org