webtester.packages.config
Class configHandler

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

public class configHandler
extends java.lang.Object

Handles parsing and validating the XML configuration file.

Author:
Aaron DeLong

Field Summary
private static boolean bFirstVarAdded
          Indicates whether a variable assignment has been added to the test case.
private static globalConfig gConfig
          Contains global configuration information.
private static int iCounter
          A counter used to maintain index counts for certain config values.
private static int iParsingFailed
          The value to return if parsing the XML document fails.
private static java.lang.String sConfigErrors
          Contains descriptions of any configuration errors encountered.
private static java.lang.String sDefaultConfigFile
          The configuration file being read.
private static java.lang.String sDescription
          The test case description.
private static java.lang.String sLastData
          The last DATA value added to the test case.
private static java.lang.String sLastMethod
          The last URL execution method added to the test case.
private static java.lang.String sLastRegex
          The last regular expressions added to the test case.
private static java.lang.String sLastSleep
          The last sleep value added to the test case.
private static java.lang.String sLastURL
          The last URL value added to the test case.
private static java.lang.String sLastVar
          The last variable assignment value added to the test case.
private static java.lang.String sTempMethod
          A temporary storage location for URL methods.
private static testCaseConfig tConfig
          Contains test case specific configuration information.
 
Constructor Summary
configHandler()
           
 
Method Summary
 void clearValues()
          Clear any values that may have been stored by a previous instance.
 java.lang.String getConfigErrors()
          Retrieve errors with the configuration file.
 globalConfig getGlobalConfiguration()
          Return an object which contains global configuration values.
 testCaseConfig getTestCaseConfigurations()
          Return an object which contains configuration values for each individual test case.
 int parseXMLDocument()
          Parse the XML document an retrieve the configuration values.
private  void parseXMLNodes(org.w3c.dom.Node node)
          Parse the XML document and save the information as it is retrieved.
 void setDefaultConfigFile(java.lang.String sFile)
          Set the configuration filename which should be used.
 void setGlobalConfiguration(globalConfig gcfg)
          Set the global configuration object.
 void setTestCaseConfiguration(testCaseConfig tcfg)
          Set the test case configuration object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sDescription

private static java.lang.String sDescription
The test case description.


sDefaultConfigFile

private static java.lang.String sDefaultConfigFile
The configuration file being read.


iCounter

private static int iCounter
A counter used to maintain index counts for certain config values.


gConfig

private static globalConfig gConfig
Contains global configuration information.


tConfig

private static testCaseConfig tConfig
Contains test case specific configuration information.


sConfigErrors

private static java.lang.String sConfigErrors
Contains descriptions of any configuration errors encountered.


sLastRegex

private static java.lang.String sLastRegex
The last regular expressions added to the test case.


sLastData

private static java.lang.String sLastData
The last DATA value added to the test case.


sLastVar

private static java.lang.String sLastVar
The last variable assignment value added to the test case.


sLastURL

private static java.lang.String sLastURL
The last URL value added to the test case.


sLastSleep

private static java.lang.String sLastSleep
The last sleep value added to the test case.


sLastMethod

private static java.lang.String sLastMethod
The last URL execution method added to the test case.


sTempMethod

private static java.lang.String sTempMethod
A temporary storage location for URL methods.


bFirstVarAdded

private static boolean bFirstVarAdded
Indicates whether a variable assignment has been added to the test case.


iParsingFailed

private static final int iParsingFailed
The value to return if parsing the XML document fails.

See Also:
Constant Field Values
Constructor Detail

configHandler

public configHandler()
Method Detail

setGlobalConfiguration

public void setGlobalConfiguration(globalConfig gcfg)
Set the global configuration object.

Parameters:
gcfg - An instance of the global configuration object

setTestCaseConfiguration

public void setTestCaseConfiguration(testCaseConfig tcfg)
Set the test case configuration object.

Parameters:
tcfg - an instance of the test caes configuration.

clearValues

public void clearValues()
Clear any values that may have been stored by a previous instance.


setDefaultConfigFile

public void setDefaultConfigFile(java.lang.String sFile)
Set the configuration filename which should be used.

Parameters:
sFile - a String which indicates the configuration file to use

getConfigErrors

public java.lang.String getConfigErrors()
Retrieve errors with the configuration file.

Returns:
a String which describes configuration errors

parseXMLNodes

private void parseXMLNodes(org.w3c.dom.Node node)
Parse the XML document and save the information as it is retrieved.

Parameters:
node - the parent node from which to begin parsing

parseXMLDocument

public int parseXMLDocument()
Parse the XML document an retrieve the configuration values.

Returns:
an integer less than 0 if any errors occurred

getGlobalConfiguration

public globalConfig getGlobalConfiguration()
Return an object which contains global configuration values.

Returns:
an instance of the globalConfig class

getTestCaseConfigurations

public testCaseConfig getTestCaseConfigurations()
Return an object which contains configuration values for each individual test case.

Returns:
an instance of the testCaseConfig class