java.lang.Object | ||||
↳ | junit.framework.Assert | |||
↳ | junit.framework.TestCase | |||
↳ | com.atlassian.jira.functest.framework.FuncTestCase | |||
↳ | com.atlassian.jira.webtests.EmailFuncTestCase |
This class is deprecated.
use EmailBaseFuncTestCase
instead to write JUnit4 tests
This class extends FuncTestCase by adding methods to test emails being sent from JIRA.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
EmailFuncTestCase.MailBox |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_FROM_ADDRESS | ||||||||||
String | DEFAULT_SUBJECT_PREFIX | ||||||||||
String | HTML_FORMAT_REGEX | ||||||||||
String | newline |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.atlassian.jira.functest.framework.FunctTestConstants
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mailService |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.jira.functest.framework.FuncTestCase
| |||||||||||
From interface
com.atlassian.jira.functest.framework.FunctTestConstants
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
individual test tear down
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Asserts that the given email's body contains the bodySubString using indexOf.
| |||||||||||
Assert that the String emailBody contains bodySubString
| |||||||||||
Asserts that the given email's body contains a line which matches the given string or pattern.
| |||||||||||
Asserts that the given email's body does not contain the bodySubString using indexOf.
| |||||||||||
Assert that the email was addressed to the expectedTo
| |||||||||||
Assert that the email was addressed to each and everyone of the expectedAddresses
| |||||||||||
Use this method to start a com.icegreen.greenmail.smtp.SmtpServer.
| |||||||||||
This is useful for writing func tests that test that the correct notifications are being sent.
| |||||||||||
Does the same as
flushMailQueueAndWait(int) but allows the user to specify the wait period in case a lot
of e-mails are being sent. | |||||||||||
Flushes the mail queue and waits for emails to arrive for specified recipients instead of a set number of emails.
| |||||||||||
Given a comma seperated list of email addresses, returns a collection of the email addresses.
| |||||||||||
Setup for an actual test
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.jira.functest.framework.FuncTestCase
| |||||||||||
From class
junit.framework.TestCase
| |||||||||||
From class
junit.framework.Assert
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.jira.testkit.client.log.FuncTestLogger
| |||||||||||
From interface
junit.framework.Test
|
MessagingException |
---|
Asserts that the given email's body contains the bodySubString using indexOf.
email to extract the content body from | |
bodySubString | expected substring of the email body |
MessagingException | Message error |
---|---|
IOException | IO error |
Assert that the String emailBody contains bodySubString
emailBody | body |
---|---|
bodySubString | expected substring |
MessagingException | message error |
---|---|
IOException | IO error |
Asserts that the given email's body contains a line which matches the given string or pattern. If multiple lines are specified, they must appear in the given order.
email to extract the content body from | |
linePattern | expected line or line pattern |
MessagingException | Message error |
---|---|
IOException | IO error |
Asserts that the given email's body does not contain the bodySubString using indexOf.
email to extract the content body from | |
bodySubString | string to not occur in body |
MessagingException | Message error |
---|---|
IOException | IO error |
MessagingException |
---|
MessagingException |
---|
IOException | |
---|---|
MessagingException |
IOException | |
---|---|
MessagingException |
MessagingException |
---|
Assert that the email was addressed to the expectedTo
email to assert the value of the to header | |
expectedTo | the single or comma seperated list of expected email addresses |
MessagingException | message error |
---|
Assert that the email was addressed to each and everyone of the expectedAddresses
email to assert the value of the to header | |
expectedToAddresses | collection of expected email addresses |
MessagingException | meesage error |
---|
MessagingException |
---|
Use this method to start a com.icegreen.greenmail.smtp.SmtpServer.
This will also configure JIRA to use this SMTP server in the admin section. You should call this after your data import. This will override any existing mail servers setup already.
A simple SMTP server proxy is started by first attempting to start on a default port number. If this port is already used we try that port number plus one and so on for 10 attempts. this allows for multiple tests running in Bamboo concurrently, and also for a particular test machine maybe using that port already.
The tearDown() method will close the TCP socket.
This is useful for writing func tests that test that the correct notifications are being sent. It goest to the admin section mail-queue and flushes the queue and waits till it recieves emailCount number of emails before timeout. If the timeout is reached before the expected number of emails arrives will fail.
emailCount | number of expected emails to wait to receive |
---|
InterruptedException | if interrupted |
---|
Does the same as flushMailQueueAndWait(int)
but allows the user to specify the wait period in case a lot
of e-mails are being sent.
emailCount | number of expected emails to wait to receive |
---|---|
waitPeriodMillis | The amount of time to wait in millis until the e-mails should have arrived. |
InterruptedException | if interrupted |
---|
Flushes the mail queue and waits for emails to arrive for specified recipients instead of a set number of emails.
waitPeriodMillis | The amount of time to wait in millis until the e-mails should have arrived. |
---|---|
recipientAddresses | the addresses to wait for or fail |
InterruptedException | if interrupted |
---|---|
MessagingException | if there is a problem extracting the sent messages |
Given a comma seperated list of email addresses, returns a collection of the email addresses.
emails | comma seperated list of email addresses |
---|
Setup for an actual test