1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Fix LocalMessageExtractorTest

This commit is contained in:
cketti 2015-01-29 17:41:46 +01:00
parent 8627e65cab
commit edf75a32d8

View File

@ -2,6 +2,7 @@ package com.fsck.k9.mailstore;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
@ -19,6 +20,7 @@ import com.fsck.k9.mail.internet.MimeMessage;
import com.fsck.k9.mail.internet.MimeMessageHelper; import com.fsck.k9.mail.internet.MimeMessageHelper;
import com.fsck.k9.mail.internet.MimeMultipart; import com.fsck.k9.mail.internet.MimeMultipart;
import com.fsck.k9.mail.internet.TextBody; import com.fsck.k9.mail.internet.TextBody;
import com.fsck.k9.mail.internet.Viewable;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -41,8 +43,10 @@ public class LocalMessageExtractorTest {
MimeMessageHelper.setBody(message, body); MimeMessageHelper.setBody(message, body);
// Extract text // Extract text
List<Part> attachments = new ArrayList<Part>();
List<Viewable> viewables = MessageExtractor.getViewables(message, attachments);
ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(), ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(),
MessageExtractor.getViewables(message, attachments), new ArrayList<Part>()); viewables, attachments);
String expectedText = bodyText; String expectedText = bodyText;
String expectedHtml = String expectedHtml =
@ -67,8 +71,10 @@ public class LocalMessageExtractorTest {
MimeMessageHelper.setBody(message, body); MimeMessageHelper.setBody(message, body);
// Extract text // Extract text
List<Part> attachments = new ArrayList<Part>();
List<Viewable> viewables = MessageExtractor.getViewables(message, attachments);
ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(), ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(),
MessageExtractor.getViewables(message, attachments), new ArrayList<Part>()); viewables, attachments);
String expectedText = "K-9 Mail rocks :>"; String expectedText = "K-9 Mail rocks :>";
String expectedHtml = String expectedHtml =
@ -99,8 +105,10 @@ public class LocalMessageExtractorTest {
MimeMessageHelper.setBody(message, multipart); MimeMessageHelper.setBody(message, multipart);
// Extract text // Extract text
List<Part> attachments = new ArrayList<Part>();
List<Viewable> viewables = MessageExtractor.getViewables(message, attachments);
ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(), ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(),
MessageExtractor.getViewables(message, attachments), new ArrayList<Part>()); viewables, attachments);
String expectedText = String expectedText =
bodyText1 + "\r\n\r\n" + bodyText1 + "\r\n\r\n" +
@ -157,8 +165,10 @@ public class LocalMessageExtractorTest {
MimeMessageHelper.setBody(message, multipart); MimeMessageHelper.setBody(message, multipart);
// Extract text // Extract text
List<Part> attachments = new ArrayList<Part>();
List<Viewable> viewables = MessageExtractor.getViewables(message, attachments);
ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(), ViewableContainer container = extractTextAndAttachments(InstrumentationRegistry.getTargetContext(),
MessageExtractor.getViewables(message, attachments), new ArrayList<Part>()); viewables, attachments);
String expectedText = String expectedText =
bodyText + bodyText +