001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package org.apache.commons.mail.mocks; 018 019 import java.io.IOException; 020 import java.util.List; 021 022 import javax.mail.MessagingException; 023 import javax.mail.internet.InternetAddress; 024 025 import org.apache.commons.mail.MultiPartEmail; 026 027 /** 028 * Extension of MultiPartEmail Class 029 * (used to allow testing only) 030 * 031 * @since 1.0 032 * @author <a href="mailto:corey.scott@gmail.com">Corey Scott</a> 033 * @version $Id: MockMultiPartEmailConcrete.java 480401 2006-11-29 04:40:04Z bayard $ 034 */ 035 public class MockMultiPartEmailConcrete extends MultiPartEmail 036 { 037 038 /** 039 * Retrieve the message content 040 * @return Message Content 041 */ 042 public String getMsg() 043 { 044 try 045 { 046 return this.getPrimaryBodyPart().getContent().toString(); 047 } 048 catch (IOException ioE) 049 { 050 return null; 051 } 052 catch (MessagingException msgE) 053 { 054 return null; 055 } 056 } 057 058 /** 059 */ 060 public void initTest() 061 { 062 this.init(); 063 } 064 065 /** 066 * @return fromAddress 067 */ 068 public InternetAddress getFromAddress() 069 { 070 return this.fromAddress; 071 } 072 073 /** 074 * @return toList 075 */ 076 public List getToList() 077 { 078 return this.toList; 079 } 080 081 /** 082 * @return bccList 083 */ 084 public List getBccList() 085 { 086 return this.bccList; 087 } 088 089 /** 090 * @return ccList 091 */ 092 public List getCcList() 093 { 094 return this.ccList; 095 } 096 097 }