*/
public void run ()
{
int i=0;
boolean tError;
HtmlLoader2 tHtmlLoad = new HtmlLoader2();
mProblemMailSent = false;
// Loop for mNumberOfIntervals, 0 means unfinite
while((i++ < mNumberOfIntervals) || (mNumberOfIntervals == 0)){
int tCounter = 0;
// In every interval load file mRunsPerInterval times
while(tCounter++ < mRunsPerInterval) {
tError=false;
String tContent=null;
long tEndTime;
long tStartTime = new Date().getTime();
boolean tResult = false;
try
{
tResult = tHtmlLoad.get(mHost, mFile, mPort, mTimeoutValue, mProtocol.equalsIgnoreCase("https"));
}
catch (java.io.InterruptedIOException ioe)
{
tResult = false;
tError = true;
System.out.println(ioe);
}
tEndTime = new Date().getTime();
if (!tResult){
if (!mProblemMailSent){
mErrorTime = tEndTime;
mUptimeTester.sendMail("DOWN", mNotLoadedMessage);
mProblemMailSent=true;
}
System.out.println(KFM_DateTimeService.createTimeStamp()+": test " + i +":" +tCounter+mNotLoadedMessage);
tError=true;
}
// Send sign of life message to the watchdog observer
// if HtmlLoad.get blocks, watchdog observer terminates the program
mWatchdogObserver.setAlive(true);
// load was successful
if(!tError){
// Check if page contains given label
tContent = tHtmlLoad.getContent();
if (tContent.indexOf(mLabel) == -1){
if (!mProblemMailSent){
mErrorTime = tEndTime;
mUptimeTester.sendMail("LABEL not found", mLabelNotFoundMessage);
mProblemMailSent=true;