slreq.verification.services.JUnit class

Package: slreq.verification.services
Superclasses:

Work with external results sources

Description

Instances of the slreq.verification.services.JUnit provides utilities for interpreting JUnit result files for verification.

Construction

JUnitService = slreq.verification.services.JUnit() directs the result fetching logic to the XML file.

Output Arguments

expand all

Services used in GetResultFcn to script up result fetching logic

Methods

The output is result that is an instance of the JUnitService object. For the resultFile with testID, the GetResultFcn function returns the result for that testID:

result = JUnitService.getResult(testID, resultFile);

The GetResultFcn fetches the result for the testID with test points in the resultFile using:

result = JUnitService.getAllResults(resultFile);

Example

Service Usage in a GetResultFcn of Link Type

 function result = GetResultFcn(link)
    testID = link.destination.id;
    testFile = link.destination.artifact;
    resultFile = getResultFile(testFile);
    
    if ~isempty(resultFile) && isfile(resultFile)
        JUnitService = slreq.verification.services.JUnit();
        result = JUnitService.getResult(testID, resultFile);
    else
        result.status = slreq.verification.Status.Unknown;
    end
end

Introduced in R2020a