{
"coverage" : 75.0, (1)
"requiredApplicationCoverage" : 40.0, (2)
"requiredResourceCoverage" : 30.0,
"requiredFlowCoverage" : 25.0,
"flowCount" : 3, (3)
"processorCount" : 4, (4)
"coveredProcessorCount": 4 (5)
"files" : [ {
"name": "sample.xml",
"flowCount" : 1, (6)
"coverage" : 100.0, (7)
"processorCount" : 2, (8)
"weight" : 100.0, (9)
"flows" : [ {
"name" : "file1Flow1" (10)
"type" : "FLOW", (11)
"coverage" : 100.0, (12)
"processorCount" : 2, (13)
"coveredProcessorCount" : 2
} ],
"name" : "file1.xml" (14)
}, {
"coverage" : 50.0,
"flowCount" : 2,
"messageProcessorCount" : 2,
"flows" : [ {
"coverage" : 0.0,
"messageProcessorCount" : 1,
"name" : "file2Flow1"
}, {
"coverage" : 100.0,
"messageProcessorCount" : 1,
"name" : "file2Flow2"
} ],
"name" : "file2.xml"
} ]
}
About MUnit Coverage Reports
The MUnit Coverage feature provides a metric on how much of a Mule application has been executed by a set of MUnit tests.
This lets you obtain a quality metric for your application.
MUnit Coverage is based on the amount of event processors executed.
MUnit Coverage provides metrics for:
-
Application overall coverage: An average of the items below.
-
Resource coverage: Refers to each Mule configuration file under src/main/mule. Each of is considered a resource by MUnit Coverage.
-
Flow coverage: Refers to any of the following components: Flows, Sub-flows, and Batch jobs.
Coverage report runs only for EE edition runtimes |
The following is a coverage report sample in JSON format.
Use the code callouts below to understand each field in the report:
1 | Coverage percentage of the whole application. |
2 | Required coverages for application, resources and flow, if the user did not configure any value it defaults to -1. |
3 | Amount of flows in the application. |
4 | Amount of event processors in the application. |
5 | Amount of covered event processors. |
6 | Amount of flows in that file. |
7 | Coverage percentage of that file. |
8 | Amount of event processors in that file. |
9 | Contribution of that file to the coverage percentage of the whole application. |
10 | Name of the flow. |
11 | Type of the top level element. Other type of top level element in coverage is error-handler. |
12 | Coverage percentage of that flow. |
13 | Amount of event processors in that flow. |
14 | Name of that file. |