webtester.packages.config
Class treeParser

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

public class treeParser
extends java.lang.Object

Parses a given JTree and updates the configuration classes based on its values.

Author:
Aaron DeLong

Field Summary
private  boolean bDefaultNotificationAddress
          Indicates whether the default notification address has been found.
private  boolean bFromAddress
          Indicates whether the from address has been found.
private  boolean bLoggingPath
          Indicates whether the logging path has been found.
private  boolean bMailServer
          Indicates whether the mailserver has been found.
private  boolean bNotificationsEnabled
          Indicates whether the notifications enabled parameter has been found.
private  boolean bNumberOfThreads
          Indicates whether the number of threads have been found.
private  boolean bRandomOrder
          Indicates whether the randomize parameter has been found.
private  boolean bRunOnlyOnce
          Indicates whether the run only once value has been found.
private  boolean bRunTime
          Indicates if the test case is only supposed to run for a specified time.
private  boolean bSpamCount
          Indicates whether the spam count parameter has been found.
private  boolean bStatsEmail
          Indicates whether the statistics email parameter has been found.
private  boolean bStatsReporting
          Indicates whether the stats reporting value has been found.
private  globalConfig gConfig
          Used to store global configuration information.
private  int iURLCounter
          A counter used for indexing test case related elements.
private static int iURLSize
          The minimum size for an ArrayList representing a URL value.
private  java.lang.String sDescription
          Contains the last test case description.
private  java.lang.String sLastTestCaseNodeVal
          Contains the value of the last test case node.
private  testCaseConfig tConfig
          Used to store test case configuration information.
private  javax.swing.tree.DefaultTreeModel treeModel
          The DefaultTreeModel instance used to retrieve values from the tree.
 
Constructor Summary
treeParser(javax.swing.tree.DefaultTreeModel tree)
          Constructor which takes the DefaultTreeModel as an argument.
 
Method Summary
 void changeTestCaseURL(java.lang.String sDesc, java.lang.String sNewURL)
          Change all URLs within the specified test case.
 globalConfig getGlobalConfig()
          Returns an instance of the globalConfig class created when parsing the tree.
 testCaseConfig getTestCaseConfig()
          Returns an instance of the testCaseConfig class created when parsing the tree.
private  java.lang.String modifyURL(java.lang.String sOldURL, java.lang.String sNewURL)
          Change the host name for the URL.
private  void parseGlobalConfigValues(java.lang.Object rootNode)
          Traverse the TreeModel, and update the configuration objects as necessary.
private  void parseTestCases(java.lang.Object rootNode)
          Parse the tree and update test case related values.
 void parseTree()
          Parse the tree into components that can be used to update the configuration classes.
 void setConfigFile(java.lang.String sFile)
          Set the configuration file within the globalConfig class.
private  void updateTestCases(java.lang.Object rootNode, java.lang.String sDesc, java.lang.String sURL)
          Update the test case with the specified information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gConfig

private globalConfig gConfig
Used to store global configuration information.


tConfig

private testCaseConfig tConfig
Used to store test case configuration information.


treeModel

private javax.swing.tree.DefaultTreeModel treeModel
The DefaultTreeModel instance used to retrieve values from the tree.


bDefaultNotificationAddress

private boolean bDefaultNotificationAddress
Indicates whether the default notification address has been found.


bNotificationsEnabled

private boolean bNotificationsEnabled
Indicates whether the notifications enabled parameter has been found.


bNumberOfThreads

private boolean bNumberOfThreads
Indicates whether the number of threads have been found.


bRunOnlyOnce

private boolean bRunOnlyOnce
Indicates whether the run only once value has been found.


bMailServer

private boolean bMailServer
Indicates whether the mailserver has been found.


bLoggingPath

private boolean bLoggingPath
Indicates whether the logging path has been found.


bSpamCount

private boolean bSpamCount
Indicates whether the spam count parameter has been found.


bFromAddress

private boolean bFromAddress
Indicates whether the from address has been found.


bStatsReporting

private boolean bStatsReporting
Indicates whether the stats reporting value has been found.


bStatsEmail

private boolean bStatsEmail
Indicates whether the statistics email parameter has been found.


bRandomOrder

private boolean bRandomOrder
Indicates whether the randomize parameter has been found.


bRunTime

private boolean bRunTime
Indicates if the test case is only supposed to run for a specified time.


sLastTestCaseNodeVal

private java.lang.String sLastTestCaseNodeVal
Contains the value of the last test case node.


sDescription

private java.lang.String sDescription
Contains the last test case description.


iURLCounter

private int iURLCounter
A counter used for indexing test case related elements.


iURLSize

private static final int iURLSize
The minimum size for an ArrayList representing a URL value.

See Also:
Constant Field Values
Constructor Detail

treeParser

public treeParser(javax.swing.tree.DefaultTreeModel tree)
Constructor which takes the DefaultTreeModel as an argument.

Parameters:
tree - instance of the DefaultTreeModel used to access tree values
Method Detail

getTestCaseConfig

public testCaseConfig getTestCaseConfig()
Returns an instance of the testCaseConfig class created when parsing the tree.

Returns:
an instance of the testCaseConfig class

getGlobalConfig

public globalConfig getGlobalConfig()
Returns an instance of the globalConfig class created when parsing the tree.

Returns:
an instance of the globalConfig class

setConfigFile

public void setConfigFile(java.lang.String sFile)
Set the configuration file within the globalConfig class.

Parameters:
sFile - the filename and path of the configuration file being edited

parseGlobalConfigValues

private void parseGlobalConfigValues(java.lang.Object rootNode)
Traverse the TreeModel, and update the configuration objects as necessary.

Parameters:
rootNode - the root node of the tree

parseTestCases

private void parseTestCases(java.lang.Object rootNode)
Parse the tree and update test case related values.

Parameters:
rootNode - the root node of the tree

updateTestCases

private void updateTestCases(java.lang.Object rootNode,
                             java.lang.String sDesc,
                             java.lang.String sURL)
Update the test case with the specified information.

Parameters:
rootNode - the root node of the tree
sDesc - the test case description
sURL - the new URL to use

modifyURL

private java.lang.String modifyURL(java.lang.String sOldURL,
                                   java.lang.String sNewURL)
Change the host name for the URL.

Parameters:
sOldURL - the old URL
sNewURL - the new hostname to be used
Returns:
a String containing the modified value

parseTree

public void parseTree()
Parse the tree into components that can be used to update the configuration classes.


changeTestCaseURL

public void changeTestCaseURL(java.lang.String sDesc,
                              java.lang.String sNewURL)
Change all URLs within the specified test case.

Parameters:
sDesc - the test case description
sNewURL - the new URL value