JUnit XML format
You can export code review result data to a file in JUnit XML format.
You can download the JUnit XML schema from
the article Apache Ant JUnit XML Schema. The mapping of
the result data to the JUnit XML format is shown in Table 1.
Type of result | JUnit XML format element | Attributes: |
---|---|---|
Analysis history: The analysis history contains all the results from a code analysis scan. |
<testsuites> |
|
Analysis provider: The analysis provider contains all results from a major grouping of rules, such as COBOL Code Review or PL/I Code Review. |
<testsuite> |
|
Analysis category: The analysis category contains all the results from a subgroup such as Performance or Program Structures. |
None. | None. However, the analysis category is listed in the text that follows the <failure> element. |
Analysis rule: The analysis rule contains a summary of the result information for a single rule. |
<testcase> |
|
Analysis result: An analysis result contains the result information for a single rule violation. |
<failure> |
|
An example of result data in the JUnit
XML format is shown in Figure 1.
Figure 1. Result data in JUnit XML format
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites id="20140612_170519" name="New_configuration (14/06/12 17:05:19)" tests="225" failures="1262" time="0.001">
<testsuite id="codereview.cobol.analysisProvider" name="COBOL Code Review" tests="45" failures="17" time="0.001">
<testcase id="codereview.cobol.rules.ProgramIdRule" name="Use a program name that matches the source file name" time="0.001">
<failure message="PROGRAM.cbl:2 Use a program name that matches the source file name" type="WARNING">
WARNING: Use a program name that matches the source file name
Category: COBOL Code Review – Naming Conventions
File: /project/PROGRAM.cbl
Line: 2
</failure>
</testcase>
</testsuite>
</testsuites>