com.atlassian.confluence.it.mail
Class MailFacade

java.lang.Object
  extended by com.atlassian.confluence.it.mail.MailFacade

public class MailFacade
extends Object

Provides common Mail methods for getting mail messages and setting User mail preferences.

Since:
v4.2

Field Summary
static String TESTMAILSERVER_HOSTNAME
           
 
Constructor Summary
MailFacade(ConfluenceRpc rpc)
           
 
Method Summary
 void addMailboxesForUsers(User... users)
           
 void addMailboxForUser(User user)
           
 void changeSmtpFromName(String fromName)
           
 void changeSmtpServerHost(String hostname, int port)
           
 javax.mail.internet.MimeMessage getExpectedMessage()
           
 javax.mail.internet.MimeMessage[] getExpectedMessages(int expectedMessages)
           
 javax.mail.internet.MimeMessage[] getMessages()
           
 int getPopPort()
           
 javax.mail.internet.MimeMessage getReceivedMessage()
           
 boolean noMessages()
           
 void removeMailServer()
           
 void reset()
           
 void send(String to, String from, String subject, String body)
           
 MailFacade start()
          Starts up and configures a new mail server which will be pulled back down during test tearDown.
 void stop()
           
 int waitForEmail(int numberOfEmails)
          Fetches the given count of emails
 void watchAsHtmlWithDiffs(User user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TESTMAILSERVER_HOSTNAME

public static final String TESTMAILSERVER_HOSTNAME
Constructor Detail

MailFacade

public MailFacade(ConfluenceRpc rpc)
Method Detail

start

public MailFacade start()
                 throws BindException
Starts up and configures a new mail server which will be pulled back down during test tearDown.

Throws:
BindException - If a free port could not be found

addMailboxesForUsers

public void addMailboxesForUsers(User... users)

addMailboxForUser

public void addMailboxForUser(User user)

getReceivedMessage

public javax.mail.internet.MimeMessage getReceivedMessage()
                                                   throws Exception
Throws:
Exception

getExpectedMessages

public javax.mail.internet.MimeMessage[] getExpectedMessages(int expectedMessages)

getMessages

public javax.mail.internet.MimeMessage[] getMessages()

noMessages

public boolean noMessages()

stop

public void stop()

removeMailServer

public void removeMailServer()

changeSmtpServerHost

public void changeSmtpServerHost(String hostname,
                                 int port)

changeSmtpFromName

public void changeSmtpFromName(String fromName)

reset

public void reset()
           throws com.icegreen.greenmail.store.FolderException
Throws:
com.icegreen.greenmail.store.FolderException

waitForEmail

public int waitForEmail(int numberOfEmails)
Fetches the given count of emails

Parameters:
numberOfEmails - the number of expected emails
Returns:
the actual number of received emails

send

public void send(String to,
                 String from,
                 String subject,
                 String body)

getPopPort

public int getPopPort()

getExpectedMessage

public javax.mail.internet.MimeMessage getExpectedMessage()

watchAsHtmlWithDiffs

public void watchAsHtmlWithDiffs(User user)


Copyright © 2003-2012 Atlassian. All Rights Reserved.