Table of Contents

Class TestwellCtcHtmlFileReader

Namespace
MES.MQC.DataSourceLibrary.Adapters.Files
Assembly
MES.MQC.DataSourceLibrary.dll
public class TestwellCtcHtmlFileReader : FileReader
Inheritance
TestwellCtcHtmlFileReader
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

IsValid(FileReaderContext)

Check if the file name is equal to 'index.html' Check if 'content' attribute of 'meta' element inside 'head' element, contains 'CTC++'

protected override bool IsValid(FileReaderContext context)

Parameters

context FileReaderContext

Context of file

Returns

bool

true if file is a valid CTC report file

Examples

<head> <meta name="generator" content="Testwell CTC++ add-on utility ctc2html v5.1"> </head>

Read(FileReaderContext)

Process all rows of second table inside body element ignore trs with just one td and with class="dirb" or class="ruler" or if value inside 'a' element in last td is equal to "DIRECTORY OVERALL" or "OVERALL" from remaining rows fetch ArtifactPath from 'a' element inside last td Names of base measures are fetch from th inside of 'thead' element, start from 3rd th and every 3rd th For each measure there is 3 variables : 'Covered', 'Uncovered' and 'Total' Values for base measures are fetch from each row start from 3rd td and every 4th td td value is like 41/42 then Covered = 41 , Total = 42, Uncovered = 1

protected override AdapterReadResult Read(FileReaderContext context)

Parameters

context FileReaderContext

Context of file

Returns

AdapterReadResult

All Data is stored in an AdapterData Model object

Examples

<table> <thead> <tr><th>TER %</th><th>-</th><th colspan = "2" > decision </th> => MeasureNames = decision < th > TER %</ th >< th > -</th > < th colspan="2">statement</th> => MeasureNames = statement <th>File</th></tr> </thead> <tbody> <tr><td class="dirb" colspan="9"></td>...</tr> => ignored <tr><td class="below">98 %</td><td class="below">-</td><td class="below">(41/42)</td> => decision.Reached = 41 , decision.Total = 42 <td width="115"><img ><img ></td><td class="below">99 %</td><td class="below">-</td><td class="below">(86/87)</td> => statement.Reached = 86 , statement.Total = 87 <td width="115"><img ><img ></td><td><a >Autopilot_Mode_Logic_sil_sil_ec.c</a></td></tr> => ArtifactPath = 'Autopilot_Mode_Logic_sil_sil_ec.c' <tr>.... <td class="dirb"><a > DIRECTORY OVERALL</a></td></tr> => ignored <tr><td class="ruler" colspan="9">&nbsp;</td></tr> => ignored <tr>....<td><a href = "indexO.html" class="underlineb">OVERALL</a></td></tr> => ignored </tbody> </table>