Clover 4.0 Release Notes
2014 年 7 月 11 日
We are happy to announce Clover 4.0.
Clover 4.0 brings completely redesigned HTML report following the Atlassian Design Guidelines (ADG).Upgrading to Clover 4.0 is free for all customers with active Clover software maintenance at the date of launch and of subsequent updates.
Changes in Clover 4.0.x bug-fix versions
This page describes new features of Clover 4.0. For changes in 4.0.x bug-fix releases, please refer to the relevant documentation:
Highlights of Clover 4.0
New ADG HTML report
Clover 4.0 brings completely redesigned HTML report with new page layout, navigation, fonts and colors. All according to the Atlassian Design Guidelines.
Project overview - dashboard
On the project overview page you will find several tabs, thanks to which you can quickly learn about your project:
- Dashboard - contains several widgets with statistics and most critical issues
- Application code - browse through application classes
- Test code - browse through test classes
- Test results - contains results from your unit tests
- Top risks - the most complex and the least covered classes
- Quick wins - "low hanging fruits"
- Coverage tree map
You can also use a package tree view with a search box to quickly jump to a package you're interested in.
Project overview and a package overview pages
A content is similar to the old report.
In addition, you can easily switch between the separated and aggregated code metrics (on a project overview page).
'Top risks' and 'Quick wins' tag clouds
Tags have a new color palette (shades of red instead of a red-blue gradient). You can also open a help box explaining how code metrics are visualized.
Coverage tree map
Tree map also has a new color palette (shades of red instead of a green-black-red gradient).
Source file view
The "Show methods" link opens a modal dialog with class details. In the "Select tests to highlight the test coverage" dialog you can see all tests hitting given source file; you can also select them to see per-test coverage. In these dialog boxes you can also quickly filter methods and tests matching given string:
Historical report
The historical report has been "ADG-ified" as well.
In case you generate several linked reports, you can easily switch between them via the "Linked reports" drop down.
Learning new ADG report
If you'd like to learn where elements from an old report are placed in the new one and how to navigate between them, see:
A side-by-side comparison of the Classic and the ADG HTML report.
Upgrading from Clover 3.3 to Clover 4.0
When upgrading from Clover 3.3 to Clover 4.0, you may need to make few changes in your build scripts.
1) Clover JAR has been renamed from com.cenqua.clover:clover to com.atlassian.clover:clover
This JAR is being used for compilation and runtime. It's a dependency of Clover-for-Maven plugin (com.atlassian.maven.plugins:maven-clover2-plugin) and Clover-for-Grails plugin (org.grails.plugins:clover). However, your Maven or Grails scripts may have a dependency to this Clover JAR declared explicitly - especially when you're running in-container tests or spawning new JVMs in a build.
You have to use a following dependency in Maven's pom.xml:
<dependency>
<groupId>com.atlassian.clover</groupId> <!-- com.cenqua.clover for Clover 3.x -->
<artifactId>clover</artifactId>
<version>4.0.0</version>
</dependency>
or in Grails' grails-app/conf/BuildConfig.groovy:
grails.project.dependency.resolution = {
plugins {
compile 'org.grails.plugins:clover:4.0.0'
}
dependencies {
compile 'com.atlassian.clover:clover:4.0.0' // com.cenqua.clover for Clover 3.x
}
}
2) Clover 4 is binary incompatible with Clover 3.
It means that source code instrumented by Clover 3 cannot be used with Clover 4 JAR at runtime and vice versa. It's caused by a fact that some runtime classes have been renamed from com.cenqua.* to com.atlassian.*.
It's recommended to delete or to rebuild all artifacts instrumented by Clover and having the 'clover' classifier (e.g. my-module-1.0-clover.jar) from ~/.m2 caches and build workspaces. When you run clover2:setup or clover:instrument, Clover tries to find an instrumented version of dependent artifacts and to use such "clovered" artifact instead of the original one. Due to a fact that some classes have been renamed in Clover 4, it may lead to java.lang.NoClassDefFoundError or java.lang.VerifyError at runtime when a JAR with old Clover instrumentation is found.
See also fatal-error-clover-could-not-be-initialised-because-of-an-unexpected-error.
3) Clover's database file format has changed.
You may need to delete existing Clover database files. In most typical environment configurations it will be done automatically (for instance, by Maven's clean goal). There is no need to delete test optimization snapshots or history points.
4) Clover no longer supports JDK5.
You have to use at least JDK6 for both compilation and runtime. Please note, that Clover still supports Java 1.3-1.5 language levels (<clover-setup source="1.4"/>, for instance).
5) Deprecated Ant types have been removed
Since Clover 3.2, the Ant 1.6.5 is no longer supported. In Clover 4.0, we've deleted Ant 1.6-specific types, such as the <clover-optimized-selector> - use the <clover-optimized-testset> instead.
6) The cloverjunitlib.xml has been merged into cloverlib.xml
This file contained definitions of Ant 1.7+ types, such as <clover-optimized-testset>. You can find these definitions in cloverlib.xml now. Example:
<taskdef resource="cloverlib.xml" classpath="clover.jar"/>
7) Clover-for-Eclipse features and plugins have new IDs.
They have been renamed from com.cenqua.*** to com.atlassian.***. Because of this, when upgrading, you have to:
- disable Clover on your projects ("Package Explorer -> context menu -> Clover -> Enable/Disable on...") - this is necessary to remove "Clover Pre-Java Builder" and "Clover Post-Java Builder",
- uninstall previous version of Clover and next install the Clover-for-Eclipse 4.x (otherwise you will end up with two Clover versions in one Eclipse),
- enable Clover on your projects.