01: /*
02: * Copyright 2001-2005 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
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: * Retrieve the message content
38: * @return Message Content
39: */
40: public String getMsg() {
41: try {
42: return this .getPrimaryBodyPart().getContent().toString();
43: } catch (IOException ioE) {
44: return null;
45: } catch (MessagingException msgE) {
46: return null;
47: }
48: }
49:
50: /**
51: */
52: public void initTest() {
53: this .init();
54: }
55:
56: /**
57: * @return fromAddress
58: */
59: public InternetAddress getFromAddress() {
60: return this .fromAddress;
61: }
62:
63: /**
64: * @return toList
65: */
66: public List getToList() {
67: return this .toList;
68: }
69:
70: /**
71: * @return bccList
72: */
73: public List getBccList() {
74: return this .bccList;
75: }
76:
77: /**
78: * @return ccList
79: */
80: public List getCcList() {
81: return this.ccList;
82: }
83:
84: }
|