|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--webtester.packages.threads.testCaseThread
The thread that is used to execute test cases.
Field Summary | |
private boolean |
bDebug
Indicates whether debugging is enabled. |
private boolean |
bFinished
Indicates whether the thread has finished executing. |
private boolean |
bNotificationsEnabled
Indicates whether notifications are enabled. |
private executionStats |
execInfo
Used to accumulate execution statistics. |
private globalConfig |
gConfig
Contains global configuration information. |
private org.apache.commons.httpclient.HostConfiguration |
hostConfiguration
Stores configuration data for the http connection. |
private org.apache.commons.httpclient.HttpClient |
httpClient
Used to make http connections, and obtain responses. |
private java.util.HashMap |
hVars
Contains variable assignment values. |
private static int |
iArgLen
The number of command-line args to pass to the Tidy class. |
private static int |
iHttpError
The value at which http return codes indicate an error. |
private static int |
iHttpPort
The default http port. |
private static int |
iSslPort
The default SSL port. |
private static int |
iTimeConversion
Used to convert time values. |
private static int |
iURLElement
The starting index to use when parsing URLs. |
private org.apache.commons.httpclient.HttpMethod |
method
Used to send GET requests. |
private org.apache.commons.httpclient.methods.MultipartPostMethod |
mpmethod
Used for uploading files. |
private org.apache.commons.httpclient.methods.PostMethod |
pmethod
Used to send POST requests. |
private java.lang.String |
sDescription
Contains the description of the test case being executed. |
private java.lang.String |
sFormData
Contains data sent to the URL, and is used in error notifications. |
private testCaseConfig |
tConfig
Contains test case specified information. |
private int |
threadid
A unique thread identifier. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
testCaseThread(globalConfig global,
testCaseConfig testcase,
java.lang.String sDesc,
executionStats exec,
int thrdid,
java.lang.String sDebug)
Constructor for the thread, which requires the objects necessary to execute a test case. |
Method Summary | |
private void |
examineResponse(java.lang.String sURL,
java.lang.String sRegex,
java.lang.String sVars,
java.lang.String sMethod)
Examine the response from the webserver, and send alerts if necessary. |
int |
getErrors()
Read the error tracking file to get the total number of errors. |
int |
getMessagesSent()
Retrieve the number of notifications sent by the application. |
private void |
incrementError()
Increment the error count and udpate the file. |
private void |
incrementMessages()
Increment the number of notifications sent by the application. |
boolean |
isFinished()
Return the value which indicates if the thread is finished. |
void |
run()
The method used to start executing a test case. |
private void |
sendData(java.lang.String sURL,
java.lang.String sMethod,
java.lang.String sData)
Calls the given URL and checks for the correctness of data. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private globalConfig gConfig
private testCaseConfig tConfig
private java.lang.String sDescription
private java.util.HashMap hVars
private org.apache.commons.httpclient.HttpMethod method
private org.apache.commons.httpclient.methods.PostMethod pmethod
private org.apache.commons.httpclient.methods.MultipartPostMethod mpmethod
private boolean bDebug
private boolean bFinished
private boolean bNotificationsEnabled
private org.apache.commons.httpclient.HttpClient httpClient
private org.apache.commons.httpclient.HostConfiguration hostConfiguration
private int threadid
private executionStats execInfo
private static final int iHttpError
private static final int iURLElement
private static final int iHttpPort
private static final int iSslPort
private static final int iTimeConversion
private java.lang.String sFormData
private static final int iArgLen
Constructor Detail |
public testCaseThread(globalConfig global, testCaseConfig testcase, java.lang.String sDesc, executionStats exec, int thrdid, java.lang.String sDebug)
global
- an instance of the globalConfig objecttestcase
- an instance of the testCaseConfig objectsDesc
- the String which describes the test casetexec
- an instance of executionStats, needed to calculate statisticsthrdid
- an integer which identifies this threadsDebug
- a String which is used to determine if debugging output should be displayedMethod Detail |
public boolean isFinished()
public int getErrors()
private void incrementError()
public int getMessagesSent()
private void incrementMessages()
private void sendData(java.lang.String sURL, java.lang.String sMethod, java.lang.String sData)
sURL
- the URL to retrievesMethod
- the method to use when submitting the URL, normally GET or POSTsData
- the data to send when submitting the URL.private void examineResponse(java.lang.String sURL, java.lang.String sRegex, java.lang.String sVars, java.lang.String sMethod)
sURL
- the URL that was calledsRegex
- the regular expression which should be evaluatedsVars
- any variable assignments which need to be performed if the regex is matchedsMethod
- the method associated with the URLpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |