1 19 20 package org.apache.james.core; 21 22 import javax.mail.Session ; 23 import javax.mail.internet.MimeMessage ; 24 25 import java.io.ByteArrayInputStream ; 26 import java.util.Properties ; 27 28 public class MimeMessageFromStreamTest extends MimeMessageTest { 29 30 protected MimeMessage getMessageFromSources(String sources) throws Exception { 31 return new MimeMessage (Session.getDefaultInstance(new Properties ()),new ByteArrayInputStream (sources.getBytes())); 32 } 33 34 protected MimeMessage getMultipartMessage() throws Exception { 35 return getMessageFromSources(getMultipartMessageSource()); 36 } 37 38 protected MimeMessage getSimpleMessage() throws Exception { 39 return getMessageFromSources(getSimpleMessageCleanedSource()); 40 } 41 42 protected MimeMessage getMessageWithBadReturnPath() throws Exception { 43 return getMessageFromSources(getMessageWithBadReturnPathSource()); 44 } 45 46 protected MimeMessage getMissingEncodingAddHeaderMessage() throws Exception { 47 return getMessageFromSources(getMissingEncodingAddHeaderSource()); 48 } 49 50 protected MimeMessage getMissingEncodingMessage() throws Exception { 51 return getMessageFromSources(getMissingEncodingMessageSource()); 52 } 53 54 55 } 56 | Popular Tags |