org.codehaus.plexus.mailsender.test
Class MockMailSender

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.codehaus.plexus.mailsender.AbstractMailSender
          extended by org.codehaus.plexus.mailsender.test.MockMailSender
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled, MailSender

public class MockMailSender
extends AbstractMailSender

Version:
$Id: MockMailSender.java 1313 2004-11-23 15:17:37Z evenisse $
Author:
Trygve Laugstøl, Emmanuel Venisse

Field Summary
 
Fields inherited from class org.codehaus.plexus.mailsender.AbstractMailSender
DEFAULT_SMTP_PORT
 
Fields inherited from interface org.codehaus.plexus.mailsender.MailSender
ROLE
 
Constructor Summary
MockMailSender()
           
 
Method Summary
 MailMessage getLastReceivedEmail()
          Returns the last received email or null if no emails has been sent.
 Iterator getReceivedEmail()
          Get email received by this instance since start up.
 MailMessage getReceivedEmail(int index)
          Returns the email with the specified index in the list of sent emails.
 int getReceivedEmailSize()
          Get the number of messages received.
 void initialize()
           
 void send(MailMessage message)
          Send a mail.
 
Methods inherited from class org.codehaus.plexus.mailsender.AbstractMailSender
getPassword, getSmtpHost, getSmtpPort, getUsername, isSslMode, send, send, setPassword, setSmtpHost, setSmtpPort, setSslMode, setUsername, verify
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockMailSender

public MockMailSender()
Method Detail

getReceivedEmail

public Iterator getReceivedEmail()
Get email received by this instance since start up.

Returns:
Returns a Iterator of MailMessages.

getLastReceivedEmail

public MailMessage getLastReceivedEmail()
Returns the last received email or null if no emails has been sent.

Returns:
Returns the last received email or null if no emails has been sent.

getReceivedEmail

public MailMessage getReceivedEmail(int index)
Returns the email with the specified index in the list of sent emails.

Parameters:
index - The index.
Returns:
Returns the email with the specified index in the list of sent emails.

getReceivedEmailSize

public int getReceivedEmailSize()
Get the number of messages received.

Returns:
Returns the number of received mails.

send

public void send(MailMessage message)
          throws MailSenderException
Description copied from interface: MailSender
Send a mail.

Throws:
MailSenderException

initialize

public void initialize()
                throws Exception
Throws:
Exception


Copyright © 2001-2011 Codehaus. All Rights Reserved.