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

Modifier and Type
Method
Description
`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(Object aContent, String aMimeType)`
`void`
`setContent(Multipart multipart)`
`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`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockMessage

public MockMessage()

## Method Details

### getFrom

public Address[] getFrom() throws MessagingException

Specified by:
  `getFrom` in interface `Message`
Throws:
  `MessagingException`

### setFrom

public void setFrom() throws MessagingException

Specified by:
  `setFrom` in interface `Message`
Throws:
  `MessagingException`

### setExpectedFrom

public void setExpectedFrom(Address anAddress)

### setFrom

public void setFrom(Address anAddress) throws MessagingException

Specified by:
  `setFrom` in interface `Message`
Throws:
  `MessagingException`

### addFrom

public void addFrom(Address[] addresses) throws MessagingException

Specified by:
  `addFrom` in interface `Message`
Throws:
  `MessagingException`

### getRecipients

public Address[] getRecipients(javax.mail.Message.RecipientType type) throws MessagingException

Specified by:
  `getRecipients` in interface `Message`
Throws:
  `MessagingException`

### setExpectedRecipients

public void setExpectedRecipients(Address[] addresses)

### setRecipients

public void setRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException

Specified by:
  `setRecipients` in interface `Message`
Throws:
  `MessagingException`

### addRecipients

public void addRecipients(javax.mail.Message.RecipientType type, Address[] addresses) throws MessagingException

Specified by:
  `addRecipients` in interface `Message`
Throws:
  `MessagingException`

### getSubject

public String getSubject() throws MessagingException

Specified by:
  `getSubject` in interface `Message`
Throws:
  `MessagingException`

### setSubject

public void setSubject(String aSubject) throws MessagingException

Specified by:
  `setSubject` in interface `Message`
Throws:
  `MessagingException`

### setExpectedSubject

public void setExpectedSubject(String aSubject)

### getSentDate

public Date getSentDate() throws MessagingException

Specified by:
  `getSentDate` in interface `Message`
Throws:
  `MessagingException`

### setExpectedSentDate

public void setExpectedSentDate(Date aDate)

### setSentDate

public void setSentDate(Date aDate) throws MessagingException

Specified by:
  `setSentDate` in interface `Message`
Throws:
  `MessagingException`

### getReceivedDate

public Date getReceivedDate() throws MessagingException

Specified by:
  `getReceivedDate` in interface `Message`
Throws:
  `MessagingException`

### getFlags

public Flags getFlags() throws MessagingException

Specified by:
  `getFlags` in interface `Message`
Throws:
  `MessagingException`

### setFlags

public void setFlags(Flags flags, boolean b) throws MessagingException

Specified by:
  `setFlags` in interface `Message`
Throws:
  `MessagingException`

### reply

public Message reply(boolean b) throws MessagingException

Specified by:
  `reply` in interface `Message`
Throws:
  `MessagingException`

### saveChanges

public void saveChanges() throws MessagingException

Specified by:
  `saveChanges` in interface `Message`
Throws:
  `MessagingException`

### getSize

public int getSize() throws MessagingException

Specified by:
  `getSize` in interface `Message`
Throws:
  `MessagingException`

### getLineCount

public int getLineCount() throws MessagingException

Specified by:
  `getLineCount` in interface `Message`
Throws:
  `MessagingException`

### getContentType

public String getContentType() throws MessagingException

Specified by:
  `getContentType` in interface `Message`
Throws:
  `MessagingException`

### isMimeType

public boolean isMimeType(String s) throws MessagingException

Specified by:
  `isMimeType` in interface `Message`
Throws:
  `MessagingException`

### getDisposition

public String getDisposition() throws MessagingException

Specified by:
  `getDisposition` in interface `Message`
Throws:
  `MessagingException`

### setDisposition

public void setDisposition(String s) throws MessagingException

Specified by:
  `setDisposition` in interface `Message`
Throws:
  `MessagingException`

### getDescription

public String getDescription() throws MessagingException

Specified by:
  `getDescription` in interface `Message`
Throws:
  `MessagingException`

### setDescription

public void setDescription(String s) throws MessagingException

Specified by:
  `setDescription` in interface `Message`
Throws:
  `MessagingException`

### getFileName

public String getFileName() throws MessagingException

Specified by:
  `getFileName` in interface `Message`
Throws:
  `MessagingException`

### setFileName

public void setFileName(String s) throws MessagingException

Specified by:
  `setFileName` in interface `Message`
Throws:
  `MessagingException`

### getInputStream

public InputStream getInputStream() throws IOException, MessagingException

Specified by:
  `getInputStream` in interface `Message`
Throws:
  `IOException`
  `MessagingException`

### getDataHandler

public DataHandler getDataHandler() throws MessagingException

Specified by:
  `getDataHandler` in interface `Message`
Throws:
  `MessagingException`

### getContent

public Object getContent() throws IOException, MessagingException

Specified by:
  `getContent` in interface `Message`
Throws:
  `IOException`
  `MessagingException`

### setDataHandler

public void setDataHandler(DataHandler handler) throws MessagingException

Specified by:
  `setDataHandler` in interface `Message`
Throws:
  `MessagingException`

### setExpectedContent

public void setExpectedContent(Object aContent, String aMimeType)

### setContent

public void setContent(Object aContent, String aMimeType) throws MessagingException

Specified by:
  `setContent` in interface `Message`
Throws:
  `MessagingException`

### setExpectedText

public void setExpectedText(String aText)

### setText

public void setText(String aText) throws MessagingException

Specified by:
  `setText` in interface `Message`
Throws:
  `MessagingException`

### setContent

public void setContent(Multipart multipart) throws MessagingException

Specified by:
  `setContent` in interface `Message`
Throws:
  `MessagingException`

### writeTo

public void writeTo(OutputStream stream) throws IOException, MessagingException

Specified by:
  `writeTo` in interface `Message`
Throws:
  `IOException`
  `MessagingException`

### getRealMessage

public javax.mail.Message getRealMessage()

Specified by:
  `getRealMessage` in interface `Message`

### getHeader

public String[] getHeader(String s) throws MessagingException

Specified by:
  `getHeader` in interface `Message`
Throws:
  `MessagingException`

### setHeader

public void setHeader(String s, String s1) throws MessagingException

Specified by:
  `setHeader` in interface `Message`
Throws:
  `MessagingException`

### addHeader

public void addHeader(String s, String s1) throws MessagingException

Specified by:
  `addHeader` in interface `Message`
Throws:
  `MessagingException`

### removeHeader

public void removeHeader(String s) throws MessagingException

Specified by:
  `removeHeader` in interface `Message`
Throws:
  `MessagingException`

### getAllHeaders

public Enumeration getAllHeaders() throws MessagingException

Specified by:
  `getAllHeaders` in interface `Message`
Throws:
  `MessagingException`

### getMatchingHeaders

public Enumeration getMatchingHeaders(String[] strings) throws MessagingException

Specified by:
  `getMatchingHeaders` in interface `Message`
Throws:
  `MessagingException`

### getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] strings) throws MessagingException

Specified by:
  `getNonMatchingHeaders` in interface `Message`
Throws:
  `MessagingException`