public interface GreenMailOperations
| Modifier and Type | Method and Description |
|---|---|
ImapServer |
getImap() |
ImapServer |
getImaps() |
Managers |
getManagers() |
Pop3Server |
getPop3() |
Pop3Server |
getPop3s() |
javax.mail.internet.MimeMessage[] |
getReceivedMessages() |
javax.mail.internet.MimeMessage[] |
getReceviedMessagesForDomain(String domain)
This method can be used as an easy 'catch-all' mechanism.
|
SmtpServer |
getSmtp() |
SmtpServer |
getSmtps() |
void |
reset()
Restart the GreenMail server.
|
void |
setQuotaSupported(boolean isEnabled)
Toggles the IMAP quota support.
|
GreenMailUser |
setUser(String login,
String password)
Sets the password for the account linked to email.
|
GreenMailUser |
setUser(String email,
String login,
String password)
Sets the password for the account linked to email.
|
void |
setUsers(Properties users)
Sets up accounts with password based on a properties map where the key is the email/login and the value the password
|
void |
start()
Start the GreenMail server
|
void |
stop()
Stop the GreenMail server.
|
boolean |
waitForIncomingEmail(int emailCount)
Does the same thing as
#wait(long, int) but with a timeout of 5000ms |
boolean |
waitForIncomingEmail(long timeout,
int emailCount)
Use this method if you are sending email in a different thread from the one you're testing from.
|
SmtpServer getSmtp()
ImapServer getImap()
Pop3Server getPop3()
SmtpServer getSmtps()
ImapServer getImaps()
Pop3Server getPop3s()
Managers getManagers()
boolean waitForIncomingEmail(long timeout,
int emailCount)
timeout - maximum time in ms to wait for emailCount of messages to arrive before giving up and returning falseemailCount - waits for these many emails to arrive before returningboolean waitForIncomingEmail(int emailCount)
#wait(long, int) but with a timeout of 5000msemailCount - waits for these many emails to arrive before returningjavax.mail.internet.MimeMessage[] getReceivedMessages()
GreenMailUtil has a bunch of static helper methods to extract body text etc.javax.mail.internet.MimeMessage[] getReceviedMessagesForDomain(String domain)
domain - returns all receved messages arrived to domain.GreenMailUser setUser(String login, String password)
login - Login for which the password should be set. This is assumed to be the same as the email address.password - New passwordGreenMailUser setUser(String email, String login, String password)
email - Email address for which the password should be setlogin - Login name for login. This may be different to the email address. E.g. the email address could be
"info@localhost", the login could be "info".password - New passwordvoid setUsers(Properties users)
users - User/password mapvoid setQuotaSupported(boolean isEnabled)
isEnabled - true, if quotas should be supported.void start()
void stop()
void reset()
Copyright © 2006-2014 Icegreen Technologies. All Rights Reserved.