public class MailToTransportUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
MailToTransportUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkDeletedEmail(String emailSubject) |
static void |
deleteAllUnreadEmailsFromGmail()
Delete all unread emails from inbox
|
static Properties |
getSMTPProperties() |
static boolean |
isMailReceivedBySubject(String emailSubject,
String folder)
Check a particular email has received to a given email folder by email subject.
|
static void |
readXMLforEmailCredentials()
Read automation.xml to set email credentials to relevant variables.
|
static boolean |
searchStringInLog(String backendURL,
String stringToFind,
String cookie) |
static boolean |
sendMailAndCheckReceived(String emailSubject)
Send email and check email received successfully
|
static boolean |
waitToCheckEmailReceived(String subjectToCheck,
String emailFolder)
This method wait to check the expected mail subject.
|
public static Properties getSMTPProperties()
public static boolean sendMailAndCheckReceived(String emailSubject) throws Exception
emailSubject - - Massage to send in emailException - - Error while sending the gmailpublic static boolean isMailReceivedBySubject(String emailSubject, String folder) throws ESBMailTransportIntegrationTestException
emailSubject - - Email emailSubject to find email is in inbox or notESBMailTransportIntegrationTestException - - Is thrown if an error occurred while reading the emailspublic static boolean checkDeletedEmail(String emailSubject) throws ESBMailTransportIntegrationTestException
emailSubject - - Subject of the email which should be deleted by ESBESBMailTransportIntegrationTestException - - Is thrown if an error occurred when reading the emailspublic static void deleteAllUnreadEmailsFromGmail()
throws ESBMailTransportIntegrationTestException
ESBMailTransportIntegrationTestException - - Is thrown if an error when deleting the emailspublic static boolean searchStringInLog(String backendURL, String stringToFind, String cookie) throws ESBMailTransportIntegrationTestException
backendURL - - server backend URLstringToFind - - string to find in the logscookie - - cookieESBMailTransportIntegrationTestException - - Is thrown if an error when getting or reading the log.public static boolean waitToCheckEmailReceived(String subjectToCheck, String emailFolder) throws ESBMailTransportIntegrationTestException
subjectToCheck - - Email Subject to check in the inboxInterruptedException - - Error occurred in thread sleepESBMailTransportIntegrationTestException - - Is thrown if an error while reading the emailspublic static void readXMLforEmailCredentials()
throws ESBMailTransportIntegrationTestException
Copyright © 2015 WSO2 Inc. All rights reserved.