1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.mail.mocks;
17
18 import java.io.IOException;
19 import java.util.List;
20
21 import javax.mail.MessagingException;
22 import javax.mail.internet.InternetAddress;
23
24 import org.apache.commons.mail.MultiPartEmail;
25
26 /***
27 * Extension of MultiPartEmail Class
28 * (used to allow testing only)
29 *
30 * @since 1.0
31 * @author <a href="mailto:corey.scott@gmail.com">Corey Scott</a>
32 * @version $Id: MockMultiPartEmailConcrete.java 240033 2005-08-25 10:03:05Z henning $
33 */
34 public class MockMultiPartEmailConcrete extends MultiPartEmail
35 {
36
37 /***
38 * Retrieve the message content
39 * @return Message Content
40 */
41 public String getMsg()
42 {
43 try
44 {
45 return this.getPrimaryBodyPart().getContent().toString();
46 }
47 catch (IOException ioE)
48 {
49 return null;
50 }
51 catch (MessagingException msgE)
52 {
53 return null;
54 }
55 }
56
57 /***
58 */
59 public void initTest()
60 {
61 this.init();
62 }
63
64 /***
65 * @return fromAddress
66 */
67 public InternetAddress getFromAddress()
68 {
69 return this.fromAddress;
70 }
71
72 /***
73 * @return toList
74 */
75 public List getToList()
76 {
77 return this.toList;
78 }
79
80 /***
81 * @return bccList
82 */
83 public List getBccList()
84 {
85 return this.bccList;
86 }
87
88 /***
89 * @return ccList
90 */
91 public List getCcList()
92 {
93 return this.ccList;
94 }
95
96 }