webtester.packages.common
Class alertHandler

java.lang.Object
  |
  +--webtester.packages.common.alertHandler

public class alertHandler
extends java.lang.Object

This class handles sending email notifications when testcases, or the application, fails.

Author:
Aaron DeLong

Field Summary
private  java.lang.String sAttachment
          Any HTML attachments to be sent with the message.
private  java.lang.String sFromAddress
          The from address used when sending the message.
private  java.lang.String sMailServer
          The mailserver used for sending messages.
private  java.lang.String sMessage
          The message body.
private  java.lang.String sRecipients
          The recipient list for the message.
private  java.lang.String sSubject
          The subject of the message.
 
Constructor Summary
alertHandler(java.lang.String sServer, java.lang.String sRecips, java.lang.String sFromAddr)
          Takes the mail server and recipient addresses as arguments.
 
Method Summary
 void addAttachment(java.lang.String sHTMLAttach)
          Adds the text as an HTML attachment to the message.
 int sendImageAlertMessage()
          Sends the message for an image.
 int sendMessage()
          Sends the message.
 void setMessageText(java.lang.String sMsg)
          Sets the body of the message that will be sent.
 void setSubject(java.lang.String sSubj)
          Sets the subject of the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sMailServer

private java.lang.String sMailServer
The mailserver used for sending messages.


sRecipients

private java.lang.String sRecipients
The recipient list for the message.


sFromAddress

private java.lang.String sFromAddress
The from address used when sending the message.


sMessage

private java.lang.String sMessage
The message body.


sAttachment

private java.lang.String sAttachment
Any HTML attachments to be sent with the message.


sSubject

private java.lang.String sSubject
The subject of the message.

Constructor Detail

alertHandler

public alertHandler(java.lang.String sServer,
                    java.lang.String sRecips,
                    java.lang.String sFromAddr)
Takes the mail server and recipient addresses as arguments.

Parameters:
sServer - the mailserver to use
sRecips - a comma-delimited list of recipients
sFromAddr - the from address to be added to the message
Method Detail

setMessageText

public void setMessageText(java.lang.String sMsg)
Sets the body of the message that will be sent.

Parameters:
sMsg - a String containing the message body

setSubject

public void setSubject(java.lang.String sSubj)
Sets the subject of the message.

Parameters:
sSubj - a String containing the message subject

addAttachment

public void addAttachment(java.lang.String sHTMLAttach)
Adds the text as an HTML attachment to the message.

Parameters:
sHTMLAttach - a String containing the HTML attachment.

sendMessage

public int sendMessage()
Sends the message.

Returns:
a negative integer if the operation failed

sendImageAlertMessage

public int sendImageAlertMessage()
Sends the message for an image.

Returns:
a negative integer if the operation failed