james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [5/5] james-project git commit: JAMES-2305 Remove unused method and unaccurate comments from MimeMessageTest
Date Mon, 22 Jan 2018 00:56:14 GMT
JAMES-2305 Remove unused method and unaccurate comments from MimeMessageTest


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0ae36b29
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0ae36b29
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0ae36b29

Branch: refs/heads/master
Commit: 0ae36b29805c37ab2141dd17a2a121abe898c916
Parents: 7244396
Author: benwa <btellier@linagora.com>
Authored: Tue Jan 16 15:20:37 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Mon Jan 22 07:48:11 2018 +0700

----------------------------------------------------------------------
 .../server/core/MimeMessageFromStreamTest.java  |  5 ---
 .../james/server/core/MimeMessageTest.java      | 39 +-------------------
 2 files changed, 1 insertion(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0ae36b29/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageFromStreamTest.java
----------------------------------------------------------------------
diff --git a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageFromStreamTest.java
b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageFromStreamTest.java
index 1c0c000..49f27b1 100644
--- a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageFromStreamTest.java
+++ b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageFromStreamTest.java
@@ -47,11 +47,6 @@ public class MimeMessageFromStreamTest extends MimeMessageTest {
     }
 
     @Override
-    protected MimeMessage getMissingEncodingAddHeaderMessage() throws Exception {
-        return getMessageFromSources(getMissingEncodingAddHeaderSource());
-    }
-
-    @Override
     protected MimeMessage getMissingEncodingMessage() throws Exception {
         return getMessageFromSources(getMissingEncodingMessageSource());
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/0ae36b29/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
----------------------------------------------------------------------
diff --git a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
index 7134a4a..479411b 100644
--- a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
+++ b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
@@ -42,16 +42,13 @@ import org.apache.mailet.base.RFC2822Headers;
 import org.apache.mailet.base.test.MimeMessageUtil;
 import org.junit.Test;
 
-/**
- * Test the subject folding issue.
- */
 public class MimeMessageTest {
 
     protected MimeMessage getSimpleMessage() throws Exception {
         return MimeMessageBuilder.mimeMessageBuilder()
             .addHeader("Date", "Tue, 16 Jan 2018 09:56:01 +0700 (ICT)")
             .setSubject("test")
-            .setText("test body")
+            .setText("test body", "text/plain; charset=us-ascii")
             .build();
     }
 
@@ -89,9 +86,6 @@ public class MimeMessageTest {
         return "X-Test: foo\r\n" + getSimpleMessageCleanedSource();
     }
 
-    /*
-     * Class under test for String getSubject()
-     */
     @Test
     public void testSimpleMessage() throws Exception {
         MimeMessage m = getSimpleMessage();
@@ -193,19 +187,11 @@ public class MimeMessageTest {
                 + "mynewco=F2=E0=F9ntent=80=E0!";
     }
 
-    /*
-     * Class under test for String getSubject()
-     */
     @Test
     public void testMultipartMessageChanges() throws Exception {
 
         MimeMessage mm = getMultipartMessage();
 
-        // ByteArrayOutputStream out = new ByteArrayOutputStream();
-        // mmCreated.writeTo(out,new String[] {"Message-ID"});
-        // String messageSource = out.toString();
-        // System.out.println(messageSource);
-
         MimeMultipart content1 = (MimeMultipart) mm.getContent();
         BodyPart b1 = content1.getBodyPart(0);
         b1.setContent("test€", "text/plain; charset=Cp1252");
@@ -234,29 +220,12 @@ public class MimeMessageTest {
 
     }
 
-    protected MimeMessage getMissingEncodingAddHeaderMessage() throws Exception {
-        MimeMessage m = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        m.setText("Testà\r\n");
-        m.setSubject("test");
-        m.saveChanges();
-        return m;
-    }
-
     protected String getMissingEncodingAddHeaderSource() {
         return "Subject: test\r\n"
                 + "\r\n"
                 + "Testà\r\n";
     }
 
-    protected String getMissingEncodingAddHeaderExpected() {
-        return "Subject: test\r\n"
-                + "MIME-Version: 1.0\r\n"
-                + "Content-Type: text/plain; charset=Cp1252\r\n"
-                + "Content-Transfer-Encoding: quoted-printable\r\n"
-                + "\r\n"
-                + "Test=E0\r\n";
-    }
-
     /**
      * This test is not usable in different locale environment.
      */
@@ -296,12 +265,6 @@ public class MimeMessageTest {
         return res;
     }
 
-    protected void debugMessage(MimeMessage mm) throws Exception {
-        System.out.println("-------------------");
-        System.out.println(getCleanedMessageSource(mm));
-        System.out.println("-------------------");
-    }
-
     protected MimeMessage getMissingEncodingMessage() throws Exception {
         MimeMessage mmCreated = new MimeMessage(Session.getDefaultInstance(new Properties()));
         mmCreated.setSubject("test");


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


Mime
View raw message