TestEnvXmlParser Class Reference

List of all members.


Detailed Description

Parser for XML test suite definition.

This class provides the functionallity to parse the XML test suite definition and to generate the test suite structure (test suite, test groups, test cases, test users).

Author:
Enrico Hartung <enrico@iptel.org>

Monica Sarbu <monica@iptel.org>

License:
GPL

Definition at line 332 of file TestEnvXmlParser.py.


Public Member Functions

def __init__
 Constructor.
def parseConfiguration
 Parse configuration data of DOM object into a 1-level dictionary.
def generateTestSuite
 Generate test environment structure from xml file.

Private Member Functions

def __handleTestSuite
 Handler for <testsuite> block of DOM document.
def __handleTestSetup
 Handler for <testsetup> block of DOM document.
def __handleTestGroup
 Handler for <testgroup> block of DOM document.
def __handleTestCase
 Handler for <testcase> block of DOM document.
def __parseUser
 Parse the <testuser> tag and replace the [$var] with value.
def __handleTestUser
 Handler for <testuser> block of DOM document.
def __parseTest
 Parse the <test> tag and replace the [$var] with value.
def __handleTestScenario
 Handler for <testscenario> block of DOM document.

Private Attributes

 __tcConf
 __rcConf
 __pcap

Static Private Attributes

 __document = None
dictionary __tcConf = {}
dictionary __rcConf = {}
dictionary __pcap = {}

Member Function Documentation

def __init__ (   self,
  xmlFileName 
)

Constructor.

Definition at line 351 of file TestEnvXmlParser.py.

def parseConfiguration (   self,
  configuration,
  name 
)

Parse configuration data of DOM object into a 1-level dictionary.

Configuration data is parsed from DOM object into URI style dictionary. e.g.: a -> b -> c = 0 becomes {'a.b.c' = 0}

Parameters:
configuration configuration data as DOM object (xml.dom.minidom.Document)
name name of top configuration element (string)
Returns:
configuration in URI style (dict)

Definition at line 371 of file TestEnvXmlParser.py.

def generateTestSuite (   self  ) 

Generate test environment structure from xml file.

All objects (TestSuite, TestGroup, TestCase, and TestUser) needed for these tests are created from data stored in the xml file.

Definition at line 406 of file TestEnvXmlParser.py.

def __handleTestSuite (   self,
  suite 
) [private]

Handler for <testsuite> block of DOM document.

Parameters:
suite parsed xml data of a test suite (xml.dom.minidom.Document)
Returns:
a new TestSuite object (testenv.core.TestSuite)

Definition at line 427 of file TestEnvXmlParser.py.

def __handleTestSetup (   self,
  setup 
) [private]

Handler for <testsetup> block of DOM document.

Parameters:
setup parsed xml data of a setup (xml.dom.minidom.Document)

Definition at line 505 of file TestEnvXmlParser.py.

def __handleTestGroup (   self,
  group 
) [private]

Handler for <testgroup> block of DOM document.

Parameters:
group parsed xml data of a test case (xml.dom.minidom.Document)
Returns:
a new TestGroup object (testenv.core.TestGroup)

Definition at line 618 of file TestEnvXmlParser.py.

def __handleTestCase (   self,
  case 
) [private]

Handler for <testcase> block of DOM document.

Parameters:
case parsed xml data of a test case (xml.dom.minidom.Document)
Returns:
a new TestCase object (testenv.core.TestCase)

Definition at line 651 of file TestEnvXmlParser.py.

def __parseUser (   self,
  user,
  vars,
  values 
) [private]

Parse the <testuser> tag and replace the [$var] with value.

Parameters:
user parsed xml data of a test user (xml.dom.minidom.Document)
vars variable names to be replaced (list of string)
values list of int values that substitute the variables (list of string)
Returns:
new test user object (testenv.core.TestUser)

Definition at line 761 of file TestEnvXmlParser.py.

def __handleTestUser (   self,
  user 
) [private]

Handler for <testuser> block of DOM document.

Parameters:
user parsed xml data of a test user (xml.dom.minidom.Document)
Returns:
new test users (list of testenv.core.TestUser)

Definition at line 881 of file TestEnvXmlParser.py.

def __parseTest (   self,
  test,
  vars,
  values 
) [private]

Parse the <test> tag and replace the [$var] with value.

Parameters:
test parsed xml data of a test (xml.dom.minidom.Document)
vars list of variable names to be replaced (list of string)
values list of int values that substitute the variables (list of string)

Definition at line 940 of file TestEnvXmlParser.py.

def __handleTestScenario (   self,
  scenario 
) [private]

Handler for <testscenario> block of DOM document.

Parameters:
scenario parsed xml data of a scenario (xml.dom.minidom.Document)
Returns:
a list of Test objects (list of testenv.core.Test)

Definition at line 1061 of file TestEnvXmlParser.py.


Member Data Documentation

__document = None [static, private]

Definition at line 335 of file TestEnvXmlParser.py.

dictionary __tcConf = {} [static, private]

Definition at line 338 of file TestEnvXmlParser.py.

dictionary __rcConf = {} [static, private]

Definition at line 341 of file TestEnvXmlParser.py.

dictionary __pcap = {} [static, private]

Definition at line 344 of file TestEnvXmlParser.py.

__tcConf [private]

Definition at line 466 of file TestEnvXmlParser.py.

__rcConf [private]

Definition at line 471 of file TestEnvXmlParser.py.

__pcap [private]

Definition at line 477 of file TestEnvXmlParser.py.


The documentation for this class was generated from the following file:

Generated on Mon Aug 11 17:28:33 2008 for TestEnv by  doxygen 1.5.5