Main Content

slreq.verification.services.JUnit class

Package: slreq.verification.services
Superclasses:

Work with external results sources

Since R2020a

Description

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

Creation

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

Version History

Introduced in R2020a