Package com.mockobjects.mail
Class MockMessage
- java.lang.Object
-
- com.mockobjects.MockObject
-
- com.mockobjects.mail.MockMessage
-
- All Implemented Interfaces:
Message,Verifiable
- Direct Known Subclasses:
MockMimeMessage
public class MockMessage extends MockObject implements Message
-
-
Constructor Summary
Constructors Constructor Description MockMessage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFrom(Address[] addresses)voidaddHeader(java.lang.String s, java.lang.String s1)voidaddRecipients(javax.mail.Message.RecipientType type, Address[] addresses)java.util.EnumerationgetAllHeaders()java.lang.ObjectgetContent()java.lang.StringgetContentType()DataHandlergetDataHandler()java.lang.StringgetDescription()java.lang.StringgetDisposition()java.lang.StringgetFileName()FlagsgetFlags()Address[]getFrom()java.lang.String[]getHeader(java.lang.String s)java.io.InputStreamgetInputStream()intgetLineCount()java.util.EnumerationgetMatchingHeaders(java.lang.String[] strings)java.util.EnumerationgetNonMatchingHeaders(java.lang.String[] strings)javax.mail.MessagegetRealMessage()java.util.DategetReceivedDate()Address[]getRecipients(javax.mail.Message.RecipientType type)java.util.DategetSentDate()intgetSize()java.lang.StringgetSubject()booleanisMimeType(java.lang.String s)voidremoveHeader(java.lang.String s)Messagereply(boolean b)voidsaveChanges()voidsetContent(java.lang.Object aContent, java.lang.String aMimeType)voidsetContent(Multipart multipart)voidsetDataHandler(DataHandler handler)voidsetDescription(java.lang.String s)voidsetDisposition(java.lang.String s)voidsetExpectedContent(java.lang.Object aContent, java.lang.String aMimeType)voidsetExpectedFrom(Address anAddress)voidsetExpectedRecipients(Address[] addresses)voidsetExpectedSentDate(java.util.Date aDate)voidsetExpectedSubject(java.lang.String aSubject)voidsetExpectedText(java.lang.String aText)voidsetFileName(java.lang.String s)voidsetFlags(Flags flags, boolean b)voidsetFrom()voidsetFrom(Address anAddress)voidsetHeader(java.lang.String s, java.lang.String s1)voidsetRecipients(javax.mail.Message.RecipientType type, Address[] addresses)voidsetSentDate(java.util.Date aDate)voidsetSubject(java.lang.String aSubject)voidsetText(java.lang.String aText)voidwriteTo(java.io.OutputStream stream)-
Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verify
-
-
-
-
Method Detail
-
getFrom
public Address[] getFrom() throws MessagingException
-
setFrom
public void setFrom() throws MessagingException
-
setExpectedFrom
public void setExpectedFrom(Address anAddress)
-
setFrom
public void setFrom(Address anAddress) throws MessagingException
-
addFrom
public void addFrom(Address[] addresses) throws MessagingException
-
getRecipients
public Address[] getRecipients(javax.mail.Message.RecipientType type) throws MessagingException- Specified by:
getRecipientsin interfaceMessage- Throws:
MessagingException
-
setExpectedRecipients
public void setExpectedRecipients(Address[] addresses)
-
setRecipients
public void setRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException- Specified by:
setRecipientsin interfaceMessage- Throws:
MessagingException
-
addRecipients
public void addRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException- Specified by:
addRecipientsin interfaceMessage- Throws:
MessagingException
-
getSubject
public java.lang.String getSubject() throws MessagingException- Specified by:
getSubjectin interfaceMessage- Throws:
MessagingException
-
setSubject
public void setSubject(java.lang.String aSubject) throws MessagingException- Specified by:
setSubjectin interfaceMessage- Throws:
MessagingException
-
setExpectedSubject
public void setExpectedSubject(java.lang.String aSubject)
-
getSentDate
public java.util.Date getSentDate() throws MessagingException- Specified by:
getSentDatein interfaceMessage- Throws:
MessagingException
-
setExpectedSentDate
public void setExpectedSentDate(java.util.Date aDate)
-
setSentDate
public void setSentDate(java.util.Date aDate) throws MessagingException- Specified by:
setSentDatein interfaceMessage- Throws:
MessagingException
-
getReceivedDate
public java.util.Date getReceivedDate() throws MessagingException- Specified by:
getReceivedDatein interfaceMessage- Throws:
MessagingException
-
getFlags
public Flags getFlags() throws MessagingException
-
setFlags
public void setFlags(Flags flags, boolean b) throws MessagingException
-
reply
public Message reply(boolean b) throws MessagingException
-
saveChanges
public void saveChanges() throws MessagingException- Specified by:
saveChangesin interfaceMessage- Throws:
MessagingException
-
getSize
public int getSize() throws MessagingException
-
getLineCount
public int getLineCount() throws MessagingException- Specified by:
getLineCountin interfaceMessage- Throws:
MessagingException
-
getContentType
public java.lang.String getContentType() throws MessagingException- Specified by:
getContentTypein interfaceMessage- Throws:
MessagingException
-
isMimeType
public boolean isMimeType(java.lang.String s) throws MessagingException- Specified by:
isMimeTypein interfaceMessage- Throws:
MessagingException
-
getDisposition
public java.lang.String getDisposition() throws MessagingException- Specified by:
getDispositionin interfaceMessage- Throws:
MessagingException
-
setDisposition
public void setDisposition(java.lang.String s) throws MessagingException- Specified by:
setDispositionin interfaceMessage- Throws:
MessagingException
-
getDescription
public java.lang.String getDescription() throws MessagingException- Specified by:
getDescriptionin interfaceMessage- Throws:
MessagingException
-
setDescription
public void setDescription(java.lang.String s) throws MessagingException- Specified by:
setDescriptionin interfaceMessage- Throws:
MessagingException
-
getFileName
public java.lang.String getFileName() throws MessagingException- Specified by:
getFileNamein interfaceMessage- Throws:
MessagingException
-
setFileName
public void setFileName(java.lang.String s) throws MessagingException- Specified by:
setFileNamein interfaceMessage- Throws:
MessagingException
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException, MessagingException- Specified by:
getInputStreamin interfaceMessage- Throws:
java.io.IOExceptionMessagingException
-
getDataHandler
public DataHandler getDataHandler() throws MessagingException- Specified by:
getDataHandlerin interfaceMessage- Throws:
MessagingException
-
getContent
public java.lang.Object getContent() throws java.io.IOException, MessagingException- Specified by:
getContentin interfaceMessage- Throws:
java.io.IOExceptionMessagingException
-
setDataHandler
public void setDataHandler(DataHandler handler) throws MessagingException- Specified by:
setDataHandlerin interfaceMessage- Throws:
MessagingException
-
setExpectedContent
public void setExpectedContent(java.lang.Object aContent, java.lang.String aMimeType)
-
setContent
public void setContent(java.lang.Object aContent, java.lang.String aMimeType) throws MessagingException- Specified by:
setContentin interfaceMessage- Throws:
MessagingException
-
setExpectedText
public void setExpectedText(java.lang.String aText)
-
setText
public void setText(java.lang.String aText) throws MessagingException
-
setContent
public void setContent(Multipart multipart) throws MessagingException- Specified by:
setContentin interfaceMessage- Throws:
MessagingException
-
writeTo
public void writeTo(java.io.OutputStream stream) throws java.io.IOException, MessagingException
-
getRealMessage
public javax.mail.Message getRealMessage()
- Specified by:
getRealMessagein interfaceMessage
-
getHeader
public java.lang.String[] getHeader(java.lang.String s) throws MessagingException
-
setHeader
public void setHeader(java.lang.String s, java.lang.String s1) throws MessagingException
-
addHeader
public void addHeader(java.lang.String s, java.lang.String s1) throws MessagingException
-
removeHeader
public void removeHeader(java.lang.String s) throws MessagingException- Specified by:
removeHeaderin interfaceMessage- Throws:
MessagingException
-
getAllHeaders
public java.util.Enumeration getAllHeaders() throws MessagingException- Specified by:
getAllHeadersin interfaceMessage- Throws:
MessagingException
-
getMatchingHeaders
public java.util.Enumeration getMatchingHeaders(java.lang.String[] strings) throws MessagingException- Specified by:
getMatchingHeadersin interfaceMessage- Throws:
MessagingException
-
getNonMatchingHeaders
public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] strings) throws MessagingException- Specified by:
getNonMatchingHeadersin interfaceMessage- Throws:
MessagingException
-
-