Table of Contents

Class TptXmlFileReader

Namespace
MES.MQC.DataSourceLibrary.Adapters.Files
Assembly
MES.MQC.DataSourceLibrary.dll
public class TptXmlFileReader : FileReader
Inheritance
TptXmlFileReader
Inherited Members

Properties

DataSource

The Data Source of the Adapter. If a report file contains data from multiple data sources, this property has to be to "Unknown" and the DataSource of each AdapterData object has to be defined.

public override string DataSource { get; }

Property Value

string

Description

Description of the Adapter that is visible in the Adapter Dialog as a popover. If the adapter is an API Connector, the description is also shown in the Add/Edit DataSource dialog, when the API Connector is selected. Absolute links get transformed into HTML Link Tags, line breaks (\n) get transformed into HTML line breaks (<br>), HTML tags are not allowed.

public override string Description { get; }

Property Value

string

FileExtensions

File Extensions of the Adapter. This property has to be defined and must have at least one file extension. The Adapter is only used for FilePaths with the defined file extensions. The IsValid method is not called unless the file extension matches.

public override List<string> FileExtensions { get; }

Property Value

List<string>

Name

Unique Name of the Adapter. Defaults to the ClassName (without Adapter / FileReader / ApiConnector suffix), can be overridden with a user defined Name.

public override string Name { get; }

Property Value

string

Methods

GetHumanReadableFilePaths(FileReaderContext)

This is a private function that combine the result of GetHumanReadableFilePath and GetHumanReadableFilePaths. If the result is empty then return human-readable files based on settings.

protected override List<string> GetHumanReadableFilePaths(FileReaderContext context)

Parameters

context FileReaderContext

Returns

List<string>

IsValid(FileReaderContext)

Check if the Header element has TptVersion attribute

protected override bool IsValid(FileReaderContext context)

Parameters

context FileReaderContext

Context of file

Returns

bool

true if file is a valid TPT report file

Read(FileReaderContext)

Parses the TPT XML file to find the summary of test results in the execution summary section and structural and requirement coverage. The artifact name is read from the system under test property of the header and when its empty from TptFileName attribute of Header.

protected override AdapterReadResult Read(FileReaderContext context)

Parameters

context FileReaderContext

Context of file

Returns

AdapterReadResult

All Data is stored in an AdapterData Model object

Examples

<Header ...> <Property Name = .../> ... <Property Name = "System Under Test" Value="SystemUnderTest"/> </Header> ... <Summary AssessmentDuration="50.533" ExecutionDuration="1039.099"> <ExecutionSummary Errors = "3" Failed="1" Inconclusive="0" Succeeded="40" Tests="44"/> </Summary>

ReadWithHumanReadableFiles(FileReaderContext, AdapterReadResult, IEnumerable<string>)

Read findings from tpt xml, if an overview.html exists use it to read the assesslet finding instead

protected override AdapterReadResult ReadWithHumanReadableFiles(FileReaderContext context, AdapterReadResult result, IEnumerable<string> humanReadableFilePaths)

Parameters

context FileReaderContext

Context of file

result AdapterReadResult

State from Read

humanReadableFilePaths IEnumerable<string>

Human readable files (html)

Returns

AdapterReadResult

All Data is stored in an AdapterReadResult