webtester.packages.config
Class testCaseConfig

java.lang.Object
  |
  +--webtester.packages.config.testCaseConfig

public class testCaseConfig
extends java.lang.Object

Contains configuration information as it relates to each individual test case.

Author:
Aaron DeLong

Field Summary
private  java.util.ArrayList aDescriptions
          Contains a list of test case descriptions.
private  java.util.HashMap hBasicPasswords
          Contains passwords for HTTP basic authentication.
private  java.util.HashMap hBasicRealms
          Contains realms for HTTP basic authentication.
private  java.util.HashMap hBasicUsers
          Contains username for HTTP basic authentication.
private  java.util.HashMap hData
          Contains data sent with URL requests.
private  java.util.HashMap hMethods
          Contains methods by which URLs are called (i.e.
private  java.util.HashMap hNoRegexes
          Contains regular expression that should not be present in examined data.
private  java.util.HashMap hNotificationAddresses
          Contains notification addresses for each test case.
private  java.util.HashMap hProxyHosts
          Contains proxy servers defined for each test case.
private  java.util.HashMap hProxyPorts
          Contains proxy ports defined for each test case.
private  java.util.HashMap hRegexes
          Contains regular expressions to match.
private  java.util.HashMap hSleepTimes
          Contains any sleep commands related to each test case.
private  java.util.HashMap hTimeouts
          Contains HTTP timeout values for each test case.
private  java.util.HashMap hURLs
          Contains URLs related to test cases.
private  java.util.HashMap hVarAssign
          Contains variable assignments for each test case.
private static int iTimeConversion
          Used when converting time from milliseconds to seconds.
private  java.lang.String sPrevURL
          The previous URL added to the test case.
 
Constructor Summary
testCaseConfig()
           
 
Method Summary
 void addBasicPassword(java.lang.String sPassword)
          For HTTP basic authentication, add the password to be used.
 void addBasicRealm(java.lang.String sRealm)
          For HTTP basic authorization, add the realm associated with the give test case.
 void addBasicUser(java.lang.String sUser)
          For HTTP basic authentication, add the user for the given realm.
 void addData(java.lang.String sData)
          Add the form data that will be submitted when a URL is called.
 void addDescription(java.lang.String sDesc)
          Store the given test case description.
 void addMethod(java.lang.String sMethod)
          Add the method to be used, normally either GET or POST.
 void addNotificationAddresses(java.lang.String sAddresses)
          Add notification addresses specific to a test case.
 void addProxyHost(java.lang.String sHost)
          Set the host value which the test case should use as a proxy.
 void addProxyPort(java.lang.String sPort)
          Add the port for the proxy server the test case should use.
 void addRegex(java.lang.String sRegex, int counter)
          Add regular expressions which are used to validate web content.
 void addSleep(java.lang.String sValue, int counter)
          The user can specify a number of seconds to wait between calling URLs.
 void addTimeout(java.lang.String sTimeout)
          Add the timeout value that should be used for HTTP connections within the test case.
 void addURL(java.lang.String sURL)
          Add a new URL, which will be associated with the last description provided.
 void addVariable(java.lang.String sValue, int counter)
          Add variable assignment information from the config file.
 void clearValues()
          Delete the currently stored values.
 java.lang.String getBasicPassword(java.lang.String sDesc)
          Retrieve the password to be used for HTTP basic authentication.
 java.lang.String getBasicRealm(java.lang.String sDesc)
          Get the realm associated with the test case.
 java.lang.String getBasicUser(java.lang.String sDesc)
          Return the user, associated with the given test case, to be used for authentication.
 java.util.ArrayList getData(java.lang.String sDesc)
          Return form data that is associated with the URLs.
 java.util.ArrayList getDescriptions()
          Return all test case descriptions.
 java.util.ArrayList getMethods(java.lang.String sDesc)
          Return methods that need to be known when submitting URLs.
 java.lang.String getNotificationAddresses(java.lang.String sDesc)
          Return notification addresses associated with the test case.
 int getNumberOfTestCases()
          Determine the number of test cases that exist in the current configuration.
 java.lang.String getProxyHost(java.lang.String sDesc)
          Return the test case's value for the proxy hostname, if any.
 java.lang.String getProxyPort(java.lang.String sDesc)
          Return the proxy port for the given test case.
 java.util.ArrayList getRegexes(java.lang.String sDesc)
          Retrieve regular expressions that are used to validate content.
 java.util.ArrayList getSleep(java.lang.String sDesc)
          If the user indicated any delays between calling URLs, then return them.
 java.lang.String getTimeout(java.lang.String sDesc)
          Return the timeout value for the testcase, if it exists.
 java.util.ArrayList getURLs(java.lang.String sDesc)
          Return URLs which are required for the specified test case.
 java.util.ArrayList getVariables(java.lang.String sDesc)
          Retrieve variable assignment information for a given test case.
 void removeLastVariable(int counter)
          Remove the last variable that was added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aDescriptions

private java.util.ArrayList aDescriptions
Contains a list of test case descriptions.


hURLs

private java.util.HashMap hURLs
Contains URLs related to test cases.


hMethods

private java.util.HashMap hMethods
Contains methods by which URLs are called (i.e. GET,POST).


hData

private java.util.HashMap hData
Contains data sent with URL requests.


hRegexes

private java.util.HashMap hRegexes
Contains regular expressions to match.


hNoRegexes

private java.util.HashMap hNoRegexes
Contains regular expression that should not be present in examined data.


hNotificationAddresses

private java.util.HashMap hNotificationAddresses
Contains notification addresses for each test case.


hVarAssign

private java.util.HashMap hVarAssign
Contains variable assignments for each test case.


hProxyHosts

private java.util.HashMap hProxyHosts
Contains proxy servers defined for each test case.


hProxyPorts

private java.util.HashMap hProxyPorts
Contains proxy ports defined for each test case.


hTimeouts

private java.util.HashMap hTimeouts
Contains HTTP timeout values for each test case.


hSleepTimes

private java.util.HashMap hSleepTimes
Contains any sleep commands related to each test case.


hBasicRealms

private java.util.HashMap hBasicRealms
Contains realms for HTTP basic authentication.


hBasicUsers

private java.util.HashMap hBasicUsers
Contains username for HTTP basic authentication.


hBasicPasswords

private java.util.HashMap hBasicPasswords
Contains passwords for HTTP basic authentication.


sPrevURL

private java.lang.String sPrevURL
The previous URL added to the test case.


iTimeConversion

private static final int iTimeConversion
Used when converting time from milliseconds to seconds.

See Also:
Constant Field Values
Constructor Detail

testCaseConfig

public testCaseConfig()
Method Detail

clearValues

public void clearValues()
Delete the currently stored values.


addDescription

public void addDescription(java.lang.String sDesc)
Store the given test case description.

Parameters:
sDesc - a String which describes a test case

getNumberOfTestCases

public int getNumberOfTestCases()
Determine the number of test cases that exist in the current configuration.

Returns:
the number of test cases found in the config file

getDescriptions

public java.util.ArrayList getDescriptions()
Return all test case descriptions.

Returns:
an ArrayList which contains all the test case descriptions

addURL

public void addURL(java.lang.String sURL)
Add a new URL, which will be associated with the last description provided.

Parameters:
sURL - the URL to add

getURLs

public java.util.ArrayList getURLs(java.lang.String sDesc)
Return URLs which are required for the specified test case.

Parameters:
sDesc - the description given for the test case
Returns:
an ArrayList which contains all URLs for the specified test case

addMethod

public void addMethod(java.lang.String sMethod)
Add the method to be used, normally either GET or POST.

Parameters:
sMethod - a String which describes the method to be used

getMethods

public java.util.ArrayList getMethods(java.lang.String sDesc)
Return methods that need to be known when submitting URLs.

Parameters:
sDesc - the description given for the test case
Returns:
an ArrayList which contains the methods necessary for submitting URLs

addData

public void addData(java.lang.String sData)
Add the form data that will be submitted when a URL is called.

Parameters:
sData - the data to add

getData

public java.util.ArrayList getData(java.lang.String sDesc)
Return form data that is associated with the URLs.

Parameters:
sDesc - the description given for the test case
Returns:
an ArrayList which contains the form data

addRegex

public void addRegex(java.lang.String sRegex,
                     int counter)
Add regular expressions which are used to validate web content.

Parameters:
sRegex - the regular expression to add
counter - indicates which URL is being accessed

getRegexes

public java.util.ArrayList getRegexes(java.lang.String sDesc)
Retrieve regular expressions that are used to validate content.

Parameters:
sDesc - the description given for the test case
Returns:
an ArrayList which contains the Perl5 regular expressions

addVariable

public void addVariable(java.lang.String sValue,
                        int counter)
Add variable assignment information from the config file.

Parameters:
sValue - the variable assignment info from the config file
counter - indicates which URL is being referenced

removeLastVariable

public void removeLastVariable(int counter)
Remove the last variable that was added.

Parameters:
counter - an index which indicates which URL in the testcase is being referenced

getSleep

public java.util.ArrayList getSleep(java.lang.String sDesc)
If the user indicated any delays between calling URLs, then return them.

Parameters:
sDesc - the test case description
Returns:
an ArrayList which indicates sleep times

addSleep

public void addSleep(java.lang.String sValue,
                     int counter)
The user can specify a number of seconds to wait between calling URLs.

Parameters:
sValue - the time in seconds, represented as a String, which the user should wait
counter - indicates which URL is being referenced

getVariables

public java.util.ArrayList getVariables(java.lang.String sDesc)
Retrieve variable assignment information for a given test case.

Parameters:
sDesc - the test case description
Returns:
an ArrayList which contains the variable assignment information

addNotificationAddresses

public void addNotificationAddresses(java.lang.String sAddresses)
Add notification addresses specific to a test case.

Parameters:
sAddresses - notification addresses that are associated with a particular test case

getNotificationAddresses

public java.lang.String getNotificationAddresses(java.lang.String sDesc)
Return notification addresses associated with the test case.

Parameters:
sDesc - the description given for the test case
Returns:
a String which contains notification addresses

addProxyHost

public void addProxyHost(java.lang.String sHost)
Set the host value which the test case should use as a proxy.

Parameters:
sHost - of the proxy server

getProxyHost

public java.lang.String getProxyHost(java.lang.String sDesc)
Return the test case's value for the proxy hostname, if any.

Parameters:
sDesc - the description for the given test case
Returns:
a String which contains the proxy server address

addProxyPort

public void addProxyPort(java.lang.String sPort)
Add the port for the proxy server the test case should use.

Parameters:
sPort - a String representing the port to use when connecting to the proxy servere

getProxyPort

public java.lang.String getProxyPort(java.lang.String sDesc)
Return the proxy port for the given test case.

Parameters:
sDesc - the test case description
Returns:
a String which contains the proxy port

addTimeout

public void addTimeout(java.lang.String sTimeout)
Add the timeout value that should be used for HTTP connections within the test case.

Parameters:
sTimeout - a String that represents the HTTP timeout, in seconds

getTimeout

public java.lang.String getTimeout(java.lang.String sDesc)
Return the timeout value for the testcase, if it exists.

Parameters:
sDesc - the test case description
Returns:
a String which contains the timeout value

addBasicRealm

public void addBasicRealm(java.lang.String sRealm)
For HTTP basic authorization, add the realm associated with the give test case.

Parameters:
sRealm - the realm being accessed

getBasicRealm

public java.lang.String getBasicRealm(java.lang.String sDesc)
Get the realm associated with the test case.

Parameters:
sDesc - the test case description
Returns:
a String containing the basic authentication realm

addBasicUser

public void addBasicUser(java.lang.String sUser)
For HTTP basic authentication, add the user for the given realm.

Parameters:
sUser - the user to use for authentication

getBasicUser

public java.lang.String getBasicUser(java.lang.String sDesc)
Return the user, associated with the given test case, to be used for authentication.

Parameters:
sDesc - the description of the test case
Returns:
a String containing the username for basic authentiation

addBasicPassword

public void addBasicPassword(java.lang.String sPassword)
For HTTP basic authentication, add the password to be used.

Parameters:
sPassword - the password to be used for authentication

getBasicPassword

public java.lang.String getBasicPassword(java.lang.String sDesc)
Retrieve the password to be used for HTTP basic authentication.

Parameters:
sDesc - the testcase description
Returns:
a String containing the password for basic authentication