|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.commons.mail.BaseEmailTestCase
public class BaseEmailTestCase
Base test case for Email test classes
Field Summary | |
---|---|
static int |
BODY_END_PAD
Padding at end of body added by wiser/send |
static int |
BODY_START_PAD
Padding at start of body added by wiser/send |
protected org.subethamail.wiser.Wiser |
fakeMailServer
The fake Wiser email server |
protected String |
strTestMailFrom
From address for the test email |
protected String |
strTestMailServer
Mail server used for testing |
protected String |
strTestMailTo
Destination address for the test email |
protected String |
strTestPasswd
Mailserver strTestPasswd (set if needed) |
protected String |
strTestURL
URL to used to test URL attachmetns (Must be valid) |
protected String |
strTestUser
Mailserver username (set if needed) |
protected String[] |
testCharsNotValid
Array of test strings |
protected String[] |
testCharsValid
Test characters acceptable to email |
Constructor Summary | |
---|---|
BaseEmailTestCase(String name)
|
Method Summary | |
---|---|
void |
getMailServer()
Initializes the stub mail server. |
protected int |
getMailServerPort()
Gets the mail server port. |
String |
getMessageAsString(int intMsgNo)
|
protected boolean |
isMailServerStopped(org.subethamail.wiser.Wiser fakeMailServer)
Checks if an email server is running at the address stored in the fakeMailServer . |
protected void |
saveEmailToFile(org.subethamail.wiser.WiserMessage email)
|
protected void |
tearDown()
|
protected org.subethamail.wiser.WiserMessage |
validateSend(org.subethamail.wiser.Wiser mailServer,
String strSubject,
javax.mail.internet.InternetAddress fromAdd,
List toAdd,
List ccAdd,
List bccAdd,
boolean boolSaveToFile)
Validate the message was sent properly |
protected void |
validateSend(org.subethamail.wiser.Wiser mailServer,
String strSubject,
javax.mail.Multipart content,
javax.mail.internet.InternetAddress fromAdd,
List toAdd,
List ccAdd,
List bccAdd,
boolean boolSaveToFile)
Validate the message was sent properly |
protected void |
validateSend(org.subethamail.wiser.Wiser mailServer,
String strSubject,
String strMessage,
javax.mail.internet.InternetAddress fromAdd,
List toAdd,
List ccAdd,
List bccAdd,
boolean boolSaveToFile)
Validate the message was sent properly |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BODY_END_PAD
public static final int BODY_START_PAD
protected org.subethamail.wiser.Wiser fakeMailServer
protected String strTestMailServer
protected String strTestMailFrom
protected String strTestMailTo
protected String strTestUser
protected String strTestPasswd
protected String strTestURL
protected String[] testCharsValid
protected String[] testCharsNotValid
Constructor Detail |
---|
public BaseEmailTestCase(String name)
name
- nameMethod Detail |
---|
protected void tearDown()
tearDown
in class junit.framework.TestCase
protected int getMailServerPort()
protected void saveEmailToFile(org.subethamail.wiser.WiserMessage email) throws IOException
email
- email
IOException
- Exceptionpublic String getMessageAsString(int intMsgNo)
intMsgNo
- the message to retrieve
public void getMailServer()
protected org.subethamail.wiser.WiserMessage validateSend(org.subethamail.wiser.Wiser mailServer, String strSubject, javax.mail.internet.InternetAddress fromAdd, List toAdd, List ccAdd, List bccAdd, boolean boolSaveToFile) throws IOException
mailServer
- reference to the fake mail serverstrSubject
- expected subjectfromAdd
- expected from addresstoAdd
- list of expected to addressesccAdd
- list of expected cc addressesbccAdd
- list of expected bcc addressesboolSaveToFile
- true will output to file, false doesnt
IOException
- Exceptionprotected void validateSend(org.subethamail.wiser.Wiser mailServer, String strSubject, javax.mail.Multipart content, javax.mail.internet.InternetAddress fromAdd, List toAdd, List ccAdd, List bccAdd, boolean boolSaveToFile) throws IOException
mailServer
- reference to the fake mail serverstrSubject
- expected subjectcontent
- the expected message contentfromAdd
- expected from addresstoAdd
- list of expected to addressesccAdd
- list of expected cc addressesbccAdd
- list of expected bcc addressesboolSaveToFile
- true will output to file, false doesnt
IOException
- Exceptionprotected void validateSend(org.subethamail.wiser.Wiser mailServer, String strSubject, String strMessage, javax.mail.internet.InternetAddress fromAdd, List toAdd, List ccAdd, List bccAdd, boolean boolSaveToFile) throws IOException
mailServer
- reference to the fake mail serverstrSubject
- expected subjectstrMessage
- the expected message as a stringfromAdd
- expected from addresstoAdd
- list of expected to addressesccAdd
- list of expected cc addressesbccAdd
- list of expected bcc addressesboolSaveToFile
- true will output to file, false doesnt
IOException
- Exceptionprotected boolean isMailServerStopped(org.subethamail.wiser.Wiser fakeMailServer)
fakeMailServer
.
fakeMailServer
- The server from which the address is picked up.
true
if the server claims to be running
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |