|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.emarsys.ecommon.mail.test.SmtpBomber
@DeclareConfiguration(name="ecommon.mail.test.smtp.bomber", type=DEFAULT) public class SmtpBomber
SmtpBomber
is a testing utility for SMTP components which
is able to create a high amount of test mails and sends them
as concurrent as possible to an SMTP server.
Field Summary | |
---|---|
protected Configuration |
config
|
protected java.util.concurrent.ExecutorService |
executors
|
protected java.lang.String |
mailText
|
protected int |
mailTextLength
|
protected int |
nbrOfMails
|
protected java.util.concurrent.atomic.AtomicInteger |
producedMailCount
|
protected int |
sendDelayMillis
|
protected java.util.concurrent.atomic.AtomicInteger |
sentMailCount
|
protected javax.mail.Session |
session
|
static java.lang.String |
SMTP_BOMBER_MAIL_TEXT_SIZE
|
static java.lang.String |
SMTP_BOMBER_MAIL_TEXT_SIZE_DEFAULT
|
static java.lang.String |
SMTP_BOMBER_NBR_OF_MAILS
|
static java.lang.String |
SMTP_BOMBER_NBR_OF_MAILS_DEFAULT
|
static java.lang.String |
SMTP_BOMBER_SEND_DELAY_MILLIS
|
static java.lang.String |
SMTP_BOMBER_SEND_DELAY_MILLIS_DEFAULT
|
static java.lang.String |
SMTP_BOMBER_SEND_NBR_OF_RETRIALS
|
static java.lang.String |
SMTP_BOMBER_SEND_NBR_OF_RETRIALS_DEFAULT
|
static java.lang.String |
SMTP_BOMBER_SEND_RETRIAL_DELAY
|
static java.lang.String |
SMTP_BOMBER_SEND_RETRIAL_DELAY_DEFAULT
|
static java.lang.String |
SMTP_BOMBER_SERVER_HOST
|
static java.lang.String |
SMTP_BOMBER_SERVER_HOST_DEFAULT
|
static java.lang.String |
SMTP_BOMBER_SERVER_PORT
|
static java.lang.String |
SMTP_BOMBER_SERVER_PORT_DEFAULT
|
Constructor Summary | |
---|---|
SmtpBomber()
TODO documentation |
|
SmtpBomber(javax.mail.Session session,
java.util.Properties props)
Creates a new SmtpBomber instance. |
Method Summary | |
---|---|
Configuration |
getConfiguration()
Provides the Configuration associated with this instance. |
int |
getProducedMailCount()
Gets the atomic value of already produced mails by this bomber instance. |
int |
getSentMailCount()
Gets the atomic value of already sent mails by this bomber instance. |
protected void |
init()
initializes the components of the bomber |
static void |
main(java.lang.String[] args)
|
protected void |
sendTestMail()
|
void |
sendTestMails(boolean awaitTermination)
TODO documentation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SMTP_BOMBER_NBR_OF_MAILS
public static final java.lang.String SMTP_BOMBER_NBR_OF_MAILS_DEFAULT
public static final java.lang.String SMTP_BOMBER_MAIL_TEXT_SIZE
public static final java.lang.String SMTP_BOMBER_MAIL_TEXT_SIZE_DEFAULT
public static final java.lang.String SMTP_BOMBER_SEND_DELAY_MILLIS
public static final java.lang.String SMTP_BOMBER_SEND_DELAY_MILLIS_DEFAULT
public static final java.lang.String SMTP_BOMBER_SEND_NBR_OF_RETRIALS
public static final java.lang.String SMTP_BOMBER_SEND_NBR_OF_RETRIALS_DEFAULT
public static final java.lang.String SMTP_BOMBER_SEND_RETRIAL_DELAY
public static final java.lang.String SMTP_BOMBER_SEND_RETRIAL_DELAY_DEFAULT
public static final java.lang.String SMTP_BOMBER_SERVER_HOST
public static final java.lang.String SMTP_BOMBER_SERVER_HOST_DEFAULT
public static final java.lang.String SMTP_BOMBER_SERVER_PORT
public static final java.lang.String SMTP_BOMBER_SERVER_PORT_DEFAULT
protected final javax.mail.Session session
protected Configuration config
protected int nbrOfMails
protected int mailTextLength
protected int sendDelayMillis
protected java.util.concurrent.ExecutorService executors
protected java.util.concurrent.atomic.AtomicInteger producedMailCount
protected java.util.concurrent.atomic.AtomicInteger sentMailCount
protected java.lang.String mailText
Constructor Detail |
---|
public SmtpBomber(javax.mail.Session session, java.util.Properties props)
SmtpBomber
instance.
session
- the JavaMail Session
whose Properties
specify
the Transport
to send the mailsprops
- Properties
that might specify
public SmtpBomber()
Method Detail |
---|
protected void init()
public Configuration getConfiguration()
Configurable
Configuration
associated with this instance.
getConfiguration
in interface Configurable
public int getProducedMailCount()
public int getSentMailCount()
protected void sendTestMail()
public void sendTestMails(boolean awaitTermination)
awaitTermination
- public static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |