Namespace: OpenEdge.ABLUnit.Writer
Type: Class ResultsXmlWriter
Parent Classes:
Inherits: Progress.Lang.Object
Implements: OpenEdge.ABLUnit.Writer.IResultsWriter


Copyright (c) 2020-2022 by Progress Software Corporation. All rights reserved.
File:ResultsXmlWriter
Purpose:Writes a test run's output to a jUnit results.xml format
Author(s):pjudge
Created:2020-02-04
Notes:* The format of the XML is per https://llg.cubic.org/docs/junit/ and/or
https://github.com/junit-team/junit5/blob/master/platform-tests/src/test/resources/jenkins-junit.xsd



Method Summary
  Options Name Purpose
  AddChildEntities (TestEntity, handle) /* Writes the details of a particular test case into the given handle @param TestEntity The test entity being written @param handle The parent XML node */
  AddChildEntities (TestEntity, handle, ICollection)
  AddTestcase (handle, TestEntity, handle) /* Creates the <testcase> tag element for every test method or test procedure. @param handle An X-NODEREF @param TestEntity The entity for which to write results @param handle The parent X-NODEREF */
  AddTestcase (handle, TestEntity, handle, ICollection)
  HANDLE CreatePropertiesElement (handle) /* Creates a properties element, which has some runtime properties added @param handle The XML document the <properties> element is added to @return handle The <properties> element */
  HANDLE CreatePropertiesElement (handle, ICollection)
  HANDLE CreateSkippedElement (handle, character) /* Adds a 'skipped' element with a message attribute @param handle the X-DOC handle @param character A message string. If an unknonw string is send, no message attribute is added. @return handle The 'skipped' element */
  HANDLE CreateSkippedElement (handle, character, ICollection)
  HANDLE CreateTraceElement (handle, TestTestResult, character) /* Creates the trace element with the given name and result in the xml file . Applicable for both error and exception nodeName: the name of the node 'error' or 'failure'. @param handle The XML document @param TestTestResult The test result @param character The name for this trace node (error/failure) @return handle The newly-populated/created trace */
  HANDLE CreateTraceElement (handle, TestTestResult, character, ICollection)
  HANDLE CreateXmlDoc () /* Creates an X-DOCUMENT @param ICollection A collection to hold any X-DOC or X-NODEREF handles for cleanup after writing of the doc @return handle The newly created X-DOCUMENT handle */
  HANDLE CreateXmlDoc (ICollection)
  HANDLE CreateXmlNode () /* Creates an X-NODEREF @return handle The newly created X-NODEREF handle */
  HANDLE CreateXmlNode (ICollection)
  WriteToFile (character, TestEntity) /* Writes the test results in the xml file @param character The XML file name. @param TestEntity The test to write (root) */
  LONGCHAR WriteToLongchar (TestEntity) /* Writes the test results to a longchar @param TestEntity The test to write (root) @param longchar The XML output, with a UTF-8 codepage */
  HANDLE WriteXml (TestEntity) /* Writes the TestEntity as XML @param TestEntity The test to write (root) @return handle The XML document (X-DOC) */
  HANDLE WriteXml (TestEntity, ICollection)

Method Detail
Top

AddChildEntities (TestEntity, handle)

/* Writes the details of a particular test case into the given handle
Parameters:
pEntity OpenEdge.ABLUnit.Model.TestEntity
 
pParentNode HANDLE
 
Top

AddChildEntities (TestEntity, handle, ICollection)

Parameters:
pEntity OpenEdge.ABLUnit.Model.TestEntity
 
pParentNode HANDLE
 
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Top

AddTestcase (handle, TestEntity, handle)

/* Creates the <testcase> tag element for every test method or test procedure.
Parameters:
pNode HANDLE
 
pEntity OpenEdge.ABLUnit.Model.TestEntity
 
pParentNode HANDLE
 
Top

AddTestcase (handle, TestEntity, handle, ICollection)

Parameters:
pNode HANDLE
 
pEntity OpenEdge.ABLUnit.Model.TestEntity
 
pParentNode HANDLE
 
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Top

HANDLE CreatePropertiesElement (handle)

/* Creates a properties element, which has some runtime properties added
Parameters:
pDoc HANDLE
 
Returns HANDLE
  handle The <properties> element
Top

HANDLE CreatePropertiesElement (handle, ICollection)

Parameters:
pDoc HANDLE
 
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Returns HANDLE
 
Top

HANDLE CreateSkippedElement (handle, character)

/* Adds a 'skipped' element with a message attribute
Parameters:
pDoc HANDLE
 
pMessage CHARACTER
 
Returns HANDLE
  handle The 'skipped' element
Top

HANDLE CreateSkippedElement (handle, character, ICollection)

Parameters:
pDoc HANDLE
 
pMessage CHARACTER
 
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Returns HANDLE
 
Top

HANDLE CreateTraceElement (handle, TestTestResult, character)

/* Creates the trace element with the given name and result in the xml file . Applicable for both error and exception
nodeName: the name of the node 'error' or 'failure'.
Parameters:
pDoc HANDLE
 
pResult OpenEdge.ABLUnit.Results.TestTestResult
 
pNodeName CHARACTER
 
Returns HANDLE
  handle The newly-populated/created trace
Top

HANDLE CreateTraceElement (handle, TestTestResult, character, ICollection)

Parameters:
pDoc HANDLE
 
pResult OpenEdge.ABLUnit.Results.TestTestResult
 
pNodeName CHARACTER
 
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Returns HANDLE
 
Top

HANDLE CreateXmlDoc ()

/* Creates an X-DOCUMENT
Returns HANDLE
  handle The newly created X-DOCUMENT handle
Top

HANDLE CreateXmlDoc (ICollection)

Parameters:
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Returns HANDLE
 
Top

HANDLE CreateXmlNode ()

/* Creates an X-NODEREF
Returns HANDLE
  handle The newly created X-NODEREF handle
Top

HANDLE CreateXmlNode (ICollection)

Parameters:
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Returns HANDLE
 
Top

WriteToFile (character, TestEntity)

/* Writes the test results in the xml file
Parameters:
pXmlFileName CHARACTER
 
pTestEntity OpenEdge.ABLUnit.Model.TestEntity
 
Top

LONGCHAR WriteToLongchar (TestEntity)

/* Writes the test results to a longchar
Parameters:
pTestEntity OpenEdge.ABLUnit.Model.TestEntity
 
Returns LONGCHAR
 
Top

HANDLE WriteXml (TestEntity)

/* Writes the TestEntity as XML
Parameters:
pTestEntity OpenEdge.ABLUnit.Model.TestEntity
 
Returns HANDLE
  handle The XML document (X-DOC)
Top

HANDLE WriteXml (TestEntity, ICollection)

Parameters:
pTestEntity OpenEdge.ABLUnit.Model.TestEntity
 
pXmlRefs OpenEdge.Core.Collections.ICollection
 
Returns HANDLE