UnitTestHarness  1.0
Unit Testing Tool
 All Data Structures Namespaces Files Functions Variables Pages
fwUnitTestComponentGenerateResultsReport.ctl File Reference

This file contains the functions to write the XML results files. A XML file is created for each of the components. More...

Functions

void fwUnitTestComponentGenerateResultsReport_createResultXml (mapping results)
 
private void fwUnitTestComponentGenerateResultsReport_setupResultsDir ()
 
private void fwUnitTestComponentGenerateResultsReport_createXmlFileForAComponent (string componentName, dyn_anytype componentResults)
 
private void fwUnitTestComponentGenerateResultsReport_addComponentToXml (int xmlDocument, string componentName, dyn_anytype componentResults)
 
private void fwUnitTestComponentGenerateResultsReport_addTestSuiteToXml (int xmlDocument, int componentElementId, string suiteName, dyn_anytype suitesResults, string componentName)
 
private void fwUnitTestComponentGenerateResultsReport_addTestCaseToXml (int xmlDocument, int suiteElementId, string caseName, dyn_anytype caseResults)
 

Variables

const int SUCCESS_INDEX = 1
 
const int FAILED_MESSAGE_INDEX = 2
 
const int CASE_EXEC_TIME_INDEX = 3
 
const int RESULTS_INDEX = 1
 
const int NUM_TESTS_INDEX = 2
 
const int NUM_FAILED_INDEX = 3
 
const int EXEC_TIME_INDEX = 4
 
const string RESULTS_DIR = PROJ_PATH + "/Results/"
 
const string RESULTS_INDEX_PATHNAME = RESULTS_DIR + "index.html"
 
const string XSL_NAME = "componentResultsFormatting.xsl"
 
const string XSL_PATHNAME = "/config/" + XSL_NAME
 
const string LIGHT_RED = "#FF9999"
 
const string LIGHT_GREEN = "#99FF99"
 

Detailed Description

This file contains the functions to write the XML results files. A XML file is created for each of the components.

Creation Date
01/04/2014

Function Documentation

private void fwUnitTestComponentGenerateResultsReport_addComponentToXml ( int  xmlDocument,
string  componentName,
dyn_anytype  componentResults 
)
Description: Adds the results for a component.
Usage
public
Parameters
[in]xmlDocumentint, id for the XML document that is being created.
[in]componentNamestring
[in]componentResultsdyn_anytype, [RESULTS, NUM_TESTS, NUM_FAILED] RESULTS is mapping, key = suite name, value = results for a suite(
See also
fwUnitTestComponentGenerateResultsReport_addTestSuiteToXml())
private void fwUnitTestComponentGenerateResultsReport_addTestCaseToXml ( int  xmlDocument,
int  suiteElementId,
string  caseName,
dyn_anytype  caseResults 
)
Description: Adds the results for a induvidual test case to the RESULTS_FILE.
Usage
public
Parameters
[in]caseResultsdyn_anytype, [SUCCESS_INDEX, FAILED_MESSAGE_INDEX,CASE_EXEC_TIME_INDEX ]
private void fwUnitTestComponentGenerateResultsReport_addTestSuiteToXml ( int  xmlDocument,
int  componentElementId,
string  suiteName,
dyn_anytype  suitesResults,
string  componentName 
)
Description: Adds the results for a induvidual test suite to the RESULTS_FILE.
Usage
public
Parameters
[in]xmlDocumentint, id for the XML document that is being created.
[in]componentElementIdint, the id for the component within the xmlDocument
[in]suiteNamestring
[in]suitesResultsdyn_anytype, [RESULTS, NUM_TESTS, NUM_FAILED] RESULTS is mapping, key = test case name, value = results for a case (
See also
fwUnitTestComponentGenerateResultsReport_addTestCaseToXml())
Parameters
[in]componentNamestring
void fwUnitTestComponentGenerateResultsReport_createResultXml ( mapping  results)
Description: Lists the components within the RESULTS_FILE and creates an XML file for each component's results.
Usage
public
Parameters
[in]resultsmapping, key = component name, value = results for a component(
See also
fwUnitTestComponentGenerateResultsReport_createXmlFileForAComponent())
private void fwUnitTestComponentGenerateResultsReport_createXmlFileForAComponent ( string  componentName,
dyn_anytype  componentResults 
)
Description: Creates the XML file for a induvidual component.
Usage
private
Parameters
[in]componentNamestring
[in]componentResultsdyn_anytype, [RESULTS, NUM_TESTS, NUM_FAILED] RESULTS is mapping, key = suite name, value = results for a suite(
See also
fwUnitTestComponentGenerateResultsReport_addTestSuiteToXml())
private void fwUnitTestComponentGenerateResultsReport_setupResultsDir ( )
Description: Creates the RESULTS_DIR and copies the XSL to the RESULTS_DIR.
Usage
private

Variable Documentation

const int CASE_EXEC_TIME_INDEX = 3
const int EXEC_TIME_INDEX = 4
const int FAILED_MESSAGE_INDEX = 2
const string LIGHT_GREEN = "#99FF99"
const string LIGHT_RED = "#FF9999"
const int NUM_FAILED_INDEX = 3
const int NUM_TESTS_INDEX = 2
const string RESULTS_DIR = PROJ_PATH + "/Results/"
const int RESULTS_INDEX = 1
const string RESULTS_INDEX_PATHNAME = RESULTS_DIR + "index.html"
const int SUCCESS_INDEX = 1
const string XSL_NAME = "componentResultsFormatting.xsl"
const string XSL_PATHNAME = "/config/" + XSL_NAME