com.mockobjects.mail

Class MockMessage

Implemented Interfaces:
Message, Verifiable
Known Direct Subclasses:
MockMimeMessage

public class MockMessage
extends MockObject
implements Message

Method Summary

void
addFrom(Address[] addresses)
void
addHeader(String s, String s1)
void
addRecipients(javax.mail.Message.RecipientType type, Address[] addresses)
Enumeration
getAllHeaders()
Object
getContent()
String
getContentType()
DataHandler
getDataHandler()
String
getDescription()
String
getDisposition()
String
getFileName()
Flags
getFlags()
Address[]
getFrom()
String[]
getHeader(String s)
InputStream
getInputStream()
int
getLineCount()
Enumeration
getMatchingHeaders(String[] strings)
Enumeration
getNonMatchingHeaders(String[] strings)
javax.mail.Message
getRealMessage()
Date
getReceivedDate()
Address[]
getRecipients(javax.mail.Message.RecipientType type)
Date
getSentDate()
int
getSize()
String
getSubject()
boolean
isMimeType(String s)
void
removeHeader(String s)
Message
reply(boolean b)
void
saveChanges()
void
setContent(Multipart multipart)
void
setContent(Object aContent, String aMimeType)
void
setDataHandler(DataHandler handler)
void
setDescription(String s)
void
setDisposition(String s)
void
setExpectedContent(Object aContent, String aMimeType)
void
setExpectedFrom(Address anAddress)
void
setExpectedRecipients(Address[] addresses)
void
setExpectedSentDate(Date aDate)
void
setExpectedSubject(String aSubject)
void
setExpectedText(String aText)
void
setFileName(String s)
void
setFlags(Flags flags, boolean b)
void
setFrom()
void
setFrom(Address anAddress)
void
setHeader(String s, String s1)
void
setRecipients(javax.mail.Message.RecipientType type, Address[] addresses)
void
setSentDate(Date aDate)
void
setSubject(String aSubject)
void
setText(String aText)
void
writeTo(OutputStream stream)

Methods inherited from class com.mockobjects.MockObject

notImplemented, notYetImplemented, verify

Method Details

addFrom

public void addFrom(Address[] addresses)
            throws MessagingException
Specified by:
addFrom in interface Message

addHeader

public void addHeader(String s,
                      String s1)
            throws MessagingException
Specified by:
addHeader in interface Message

addRecipients

public void addRecipients(javax.mail.Message.RecipientType type,
                          Address[] addresses)
            throws MessagingException
Specified by:
addRecipients in interface Message

getAllHeaders

public Enumeration getAllHeaders()
            throws MessagingException
Specified by:
getAllHeaders in interface Message

getContent

public Object getContent()
            throws IOException,
                   MessagingException
Specified by:
getContent in interface Message

getContentType

public String getContentType()
            throws MessagingException
Specified by:
getContentType in interface Message

getDataHandler

public DataHandler getDataHandler()
            throws MessagingException
Specified by:
getDataHandler in interface Message

getDescription

public String getDescription()
            throws MessagingException
Specified by:
getDescription in interface Message

getDisposition

public String getDisposition()
            throws MessagingException
Specified by:
getDisposition in interface Message

getFileName

public String getFileName()
            throws MessagingException
Specified by:
getFileName in interface Message

getFlags

public Flags getFlags()
            throws MessagingException
Specified by:
getFlags in interface Message

getFrom

public Address[] getFrom()
            throws MessagingException
Specified by:
getFrom in interface Message

getHeader

public String[] getHeader(String s)
            throws MessagingException
Specified by:
getHeader in interface Message

getInputStream

public InputStream getInputStream()
            throws IOException,
                   MessagingException
Specified by:
getInputStream in interface Message

getLineCount

public int getLineCount()
            throws MessagingException
Specified by:
getLineCount in interface Message

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] strings)
            throws MessagingException
Specified by:
getMatchingHeaders in interface Message

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] strings)
            throws MessagingException
Specified by:
getNonMatchingHeaders in interface Message

getRealMessage

public javax.mail.Message getRealMessage()
Specified by:
getRealMessage in interface Message

getReceivedDate

public Date getReceivedDate()
            throws MessagingException
Specified by:
getReceivedDate in interface Message

getRecipients

public Address[] getRecipients(javax.mail.Message.RecipientType type)
            throws MessagingException
Specified by:
getRecipients in interface Message

getSentDate

public Date getSentDate()
            throws MessagingException
Specified by:
getSentDate in interface Message

getSize

public int getSize()
            throws MessagingException
Specified by:
getSize in interface Message

getSubject

public String getSubject()
            throws MessagingException
Specified by:
getSubject in interface Message

isMimeType

public boolean isMimeType(String s)
            throws MessagingException
Specified by:
isMimeType in interface Message

removeHeader

public void removeHeader(String s)
            throws MessagingException
Specified by:
removeHeader in interface Message

reply

public Message reply(boolean b)
            throws MessagingException
Specified by:
reply in interface Message

saveChanges

public void saveChanges()
            throws MessagingException
Specified by:
saveChanges in interface Message

setContent

public void setContent(Multipart multipart)
            throws MessagingException
Specified by:
setContent in interface Message

setContent

public void setContent(Object aContent,
                       String aMimeType)
            throws MessagingException
Specified by:
setContent in interface Message

setDataHandler

public void setDataHandler(DataHandler handler)
            throws MessagingException

setDescription

public void setDescription(String s)
            throws MessagingException
Specified by:
setDescription in interface Message

setDisposition

public void setDisposition(String s)
            throws MessagingException
Specified by:
setDisposition in interface Message

setExpectedContent

public void setExpectedContent(Object aContent,
                               String aMimeType)

setExpectedFrom

public void setExpectedFrom(Address anAddress)

setExpectedRecipients

public void setExpectedRecipients(Address[] addresses)

setExpectedSentDate

public void setExpectedSentDate(Date aDate)

setExpectedSubject

public void setExpectedSubject(String aSubject)

setExpectedText

public void setExpectedText(String aText)

setFileName

public void setFileName(String s)
            throws MessagingException
Specified by:
setFileName in interface Message

setFlags

public void setFlags(Flags flags,
                     boolean b)
            throws MessagingException
Specified by:
setFlags in interface Message

setFrom

public void setFrom()
            throws MessagingException
Specified by:
setFrom in interface Message

setFrom

public void setFrom(Address anAddress)
            throws MessagingException
Specified by:
setFrom in interface Message

setHeader

public void setHeader(String s,
                      String s1)
            throws MessagingException
Specified by:
setHeader in interface Message

setRecipients

public void setRecipients(javax.mail.Message.RecipientType type,
                          Address[] addresses)
            throws MessagingException
Specified by:
setRecipients in interface Message

setSentDate

public void setSentDate(Date aDate)
            throws MessagingException
Specified by:
setSentDate in interface Message

setSubject

public void setSubject(String aSubject)
            throws MessagingException
Specified by:
setSubject in interface Message

setText

public void setText(String aText)
            throws MessagingException
Specified by:
setText in interface Message

writeTo

public void writeTo(OutputStream stream)
            throws IOException,
                   MessagingException
Specified by:
writeTo in interface Message

Copyright © 2002 Mock Objects. All Rights Reserved.