public abstract class GreenMailProxy extends ConfiguredGreenMail
| Constructor and Description |
|---|
GreenMailProxy() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract GreenMail |
getGreenMail() |
ImapServer |
getImap() |
ImapServer |
getImaps() |
Managers |
getManagers() |
Pop3Server |
getPop3() |
Pop3Server |
getPop3s() |
MimeMessage[] |
getReceivedMessages() |
MimeMessage[] |
getReceivedMessagesForDomain(String domain)
Gets all messages containing given domain.
|
SmtpServer |
getSmtp() |
SmtpServer |
getSmtps() |
UserManager |
getUserManager() |
void |
purgeEmailFromAllMailboxes()
Remove/purge all data from all mail stores (POP3/IMAP)
|
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
GreenMailOperations.waitForIncomingEmail(long, int) but with a default 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.
|
doConfigure, withConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRunningpublic SmtpServer getSmtp()
public ImapServer getImap()
public Pop3Server getPop3()
public SmtpServer getSmtps()
public ImapServer getImaps()
public Pop3Server getPop3s()
public Managers getManagers()
public UserManager getUserManager()
public boolean waitForIncomingEmail(long timeout,
int emailCount)
GreenMailOperationstimeout - 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 returningpublic boolean waitForIncomingEmail(int emailCount)
GreenMailOperationsGreenMailOperations.waitForIncomingEmail(long, int) but with a default timeout of 5000msemailCount - waits for these many emails to arrive before returningpublic MimeMessage[] getReceivedMessages()
GreenMailUtil has a bunch of static helper methods to extract body text etc.public MimeMessage[] getReceivedMessagesForDomain(String domain)
GreenMailOperationsdomain - the domain, such as 'icegreen.com' or 'some.example.com'public GreenMailUser setUser(String login, String password)
GreenMailOperationslogin - Login for which the password should be set. This is assumed to be the same as the email address.password - New passwordpublic GreenMailUser setUser(String email, String login, String password)
GreenMailOperationsemail - 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 passwordpublic void setUsers(Properties users)
GreenMailOperationsusers - User/password mappublic void setQuotaSupported(boolean isEnabled)
GreenMailOperationsisEnabled - true, if quotas should be supported.public void start()
GreenMailOperationspublic void stop()
GreenMailOperationspublic void reset()
GreenMailOperationspublic void purgeEmailFromAllMailboxes()
throws FolderException
GreenMailOperationsFolderException - on errorprotected abstract GreenMail getGreenMail()
Copyright © 2006–2022 Icegreen Technologies. All rights reserved.