Skip to end of metadata
Go to start of metadata
All Versions
Clover 2.5 Documentation

This page documents Clover-for-Ant's implementation of JSON data and how to make use of it.

On this page:

Why JSON?

The JSON format is supported as an output type in Clover specifically to create integration opportunities with other applications. The JSON data from Clover is easy to manipulate programmatically, allowing innovative developers to use it for displaying or processing their coverage data in novel ways.

Clover-Ant code for JSON output

Examples of JSON report usage

JSON for a file page:

The "lines" array contains the hit counts for each line in the BCodec.java file.

JSON in an HTML page:



JSON live demo
This example uses JavaScript alerts to display the JSON data. Click here to run the live demo.

Clover Historical Data in JSONP

You can also access Clover historical data using JSON or JSONP. If your coverage data is available online, you could view your coverage inside a Google Gadget.

Using this data, you can create your own visualisations in Javascript or HTML. The data from Clover is compatible with the Google Visualisation API.

Basic example:

This is the basic JSON object produced by Clover. The above JSON object may be passed directly to a google.visualization.DataTable constructor like so:

Example for use with Javascript:

Example Clover Gadget:

The screenshot below shows Clover historical data in a Gadget:

The XML source for this gadget is as follows:

Screenshot: Clover in a Google Gadget

Labels
  • None



Log a request with our support team.



Raise an issue for our developers.



See answers from the community.



Tweet, blog and update our documentation.

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 2.5 Australia License.