BIRD AT-800 Operation Manual

Antenna tester
Hide thumbs Also See for AT-800:
Table of Contents

Advertisement

Quick Links

1. Clover Documentation Home . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 About Clover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.1 About Code Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.2 About Distributed Per-Test Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.3 About Test Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 Supported Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3 Clover-for-Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3.1 Clover-for-Eclipse Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.1.1 Changes in 2.0.0.b2_1 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.1.2 Changes in 2.0.0 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.1.3 Changes in 2.0.1 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.1.4 Changes in 2.0.2 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.1.5 Changes in 2.0.3 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3.1.6 Changes in 2.1.0 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3.1.7 Changes in 2.2.1 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3.1.8 Changes in 2.3.1 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.3.1.9 Changes in 2.3.2 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.3.1.10 Changes in 2.4.0 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.3.1.11 Changes in 2.4.2 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3.1.12 Changes in 2.4.3 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3.1.13 Changes in 2.5.0 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.3.1.14 Changes in 2.5.1 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.3.1.15 Changes in 2.6.0 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.3.1.16 Changes in 2.6.2 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.3.1.17 Changes in 2.6.3 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.3.1.18 Changes in 3.0.0 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3.1.19 Changes in 3.1.0 for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3.2 Clover-for-Eclipse Glossary of Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3.3 Clover-for-Eclipse Installation Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.3.3.1 Installing Clover-for-Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3.3.2 Installing Older Versions of Clover-for-Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.3.4 Clover-for-Eclipse Upgrade Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.3.5 Clover-for-Eclipse User's Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.3.5.2 Launching an Ant build from Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.5.3 Performance Tuning in Clover for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.3.5.4 Test Optimization for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.4 Clover-for-IDEA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
1.4.1 Clover-for-IDEA Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
1.4.1.1 Changes in 2.3.1-beta1 for IDEA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AT-800 and is the answer not in the manual?

Questions and answers

Summary of Contents for BIRD AT-800

  • Page 1: Table Of Contents

    1. Clover Documentation Home ................6 1.1 About Clover .
  • Page 2 1.4.1.2 Changes in 2.3.2-beta2 for IDEA ............. . 57 1.4.1.3 Changes in 2.3.2-beta3 for IDEA .
  • Page 3 1.5.4.6.4 clover-historypoint ..............131 1.5.4.6.5 clover-html-report .
  • Page 4 1.11.2 Tutorial - Using Clover with Ant and JUnit ............236 1.11.2.1 Part 1 - Measuring Coverage .
  • Page 5 1.16 Contributing to the Clover Documentation ..............272 2.
  • Page 6: Clover Documentation Home

    Clover 3.1 Documentation Clover Documentation Home Clover 3.1.x Learn About Clover Find out everything you'll need to know about Clover's code coverage analysis capabilities in our detailed About page , our detailed Feature Tour , hands-on Tutorials Video . See also the Test Optimization overview to get cracking with this advanced Clover feature and the What's New...
  • Page 7: About Clover

    Clover 3.1 Documentation Clover for Maven 1 Clover for Maven 1 brings Atlassian's award-winning code coverage analysis to the popular Maven 1 build automation tool. See the Installation Guide to get started, while the User's Guide is for digging into Clover's advanced reporting. Evaluators, see the Latest Version information and Download...
  • Page 8 Clover 3.1 Documentation About Code Coverage What is Code Coverage? Code coverage is the percentage of code which is covered by automated tests. Code coverage measurement simply determines which statements in a body of code have been executed through a test run, and which statements have not. In general, a code coverage system collects information about the running program and then combines that with source information to generate a report on the test suite's code coverage.
  • Page 9: About Distributed Per-Test Coverage

    Clover 3.1 Documentation Branch Branch coverage (sometimes called Decision Coverage) measures which possible branches in flow control structures are followed. Clover does this by recording if the boolean expression in the control structure evaluated to both true and false during execution. In Groovy code, Clover also treats Elvis expressions (a :? b), safe method calls (a?.b()), safe property calls (a?.b) and safe attribute calls (a?.@b) as branches.
  • Page 10: About Clover Editions

    Clover 3.1 Documentation The following is a general outline of what is required to enable Clover to optimize the test and build process. A full clean build is performed. Any existing Clover databases are removed. Clover performs instrumentation on all Java source files. The Clover registry is created. javac compiles the instrumented sources All unit tests are run.
  • Page 11: Supported Platforms

    Clover 3.1 Documentation This page contains information about the different editions of Clover. On this page: Overview Clover Desktop Edition Clover Server Edition Overview Clover editions were introduced with the release of Clover 2.6, in September 2009. Previous versions of Clover do not belong to a particular edition.
  • Page 12: Clover-For-Eclipse

    Clover 3.1 Documentation Apache Maven 3 3.0.0 or later Application Development Frameworks Grails 1.2 or later Integrated Development Environments (IDEs) JetBrains IntelliJ IDEA 7.0 or later Eclipse 3.2 or later, RAD 7 & 7.5 Visual Studio.NET Supported Platform Notes You can download a JRE or JDK for Windows/Linux/Solaris.
  • Page 13: Clover-For-Eclipse Changelog

    Clover 3.1 Documentation Offline Documentation You can download the Clover documentation in PDF, HTML or XML format. Recently Updated No recent updates found. Clover-for-Eclipse Changelog See also Clover-for-Ant Changelog Clover-for-Eclipse Changelog All versions Changes in 3.1.0 for Eclipse Changes in 3.0.0 for Eclipse Changes in 2.6.3 for Eclipse Changes in 2.6.2 for Eclipse Changes in 2.6.0 for Eclipse...
  • Page 14: Changes In 2.0.0 For Eclipse

    Clover 3.1 Documentation Changes in 2.0.0.b2_1 for Eclipse 21 September, 2007 This is a bug fix and usability release. Please also see the core Clover 2 changelog. Improvements [CLEP-134] Usability improvements to feature/plugin upgrades. [CLEP-133] Add acknowledgements page to about dialog for open source libraries used in Clover. Bugs Fixed [CLEP-135] Cut dependency between Clover Core feature/plugin and Clover JDT Hooks feature/plugin so each can be installed independently of the other.
  • Page 15: Changes In 2.0.3 For Eclipse

    Clover 3.1 Documentation APP_UNKNOWN; Unknown Application: {0}; ["confluence:4557196"] JIRA Issues (0 issues) Type Summary Assignee Reporter Priority Status Resolution Created Updated Changes in 2.0.3 for Eclipse Changes in 2.0.3 for Eclipse 03 December, 2007 This release fixes some minor bugs and adds some new features. The full version of this release of the Clover-for-Eclipse plugin is 2.0.3.v20071203123733.
  • Page 16: Changes In 2.3.1 For Eclipse

    Clover 3.1 Documentation CEP-37 Support for displaying test coverage information in the Test Run Explorer and Test Contributions views that spans multiple projects in the workspace. CEP-70 HTML/PDF/XML reports can now be generated across multiple projects. CEP-94 HTML/PDF/XML report generation can be forked to better handle reporting on large projects. CEP-23 Addition of a button to the Coverage Explorer and Test Run Explorer to simultaneously switch Clover on or off for multiple projects.
  • Page 17 Clover 3.1 Documentation Changes in 2.3.2 for Eclipse Changes in 2.3.2 for Eclipse 16 Sep, 2008 - Build 20080916 This is a minor bug fix release. The full Eclipse version number for this build of the plugin is 2.3.2.v20080916093000. Changes since the last build include: Bug Fixes CEP-162...
  • Page 18: Changes In 2.4.0 For Eclipse

    Clover 3.1 Documentation CEP-151 Filtering out source files causes silent compilation errors in non-filtered classes. Changes in 2.3.2 Beta 2 for Eclipse 09 July, 2008 - Beta 2 Build 20080709 This is an important beta release which provides support for RAD 7 and also addresses a small number of fixes for bugs found since the laste beta.
  • Page 19: Changes In 2.4.2 For Eclipse

    Clover 3.1 Documentation CEP-167 NaN values displayed incorrectly in the Coverage Explorer CEP-171 Custom percentage-based columns show 100 times their real value Changes in 2.4.2 for Eclipse Changes in 2.4.2 for Eclipse 12 Jan, 2009 - Build 20090112 This is a bug fix, performance and useability release. The full Eclipse version number for this build of the plugin is 2.4.2.v20090112XXXXXX. Changes since the last release include: Performance Enhancements CEP-201...
  • Page 20: Changes In 2.5.0 For Eclipse

    Clover 3.1 Documentation Bug Fixes CEP-233 Fixed problem where source coverage annotations and test contributions display may not reliably display. CEP-237 Fixed Clover Eclipse Ant support so that the property ${clover.eclipse.runtime.jar} is always resolved. Changes in 2.5.0 for Eclipse Changes in 2.5.0 for Eclipse 11 May, 2009 - Build 20090511 Clover's much-lauded feature called Test Optimization is now available in Clover for Eclipse, bringing the ability to run only the tests that have been affected by changes to program code.
  • Page 21: Changes In 2.5.1 For Eclipse

    Clover 3.1 Documentation CEP-313 Plugin Startup is Slow and Throws Many Exceptions. CEP-311 Clover-enabled projects should always show in the explorers regardless of their load state. CEP-310 Snapshot should be discarded after N test runs not compiles due to frequent incremental compilations in IDE. CEP-306 NPEs in Test Run Explorer.
  • Page 22: Changes In 2.6.2 For Eclipse

    Clover 3.1 Documentation JIRA Issues (8 issues) Summary Priority Status CLOV-721 Don't reload all per-test data when some has been added Closed CLOV-718 Test Run Explore fails if a test method's source has been removed Resolved CLOV-642 Display SID on Clover Preference panel - License Closed CLOV-630 Run Optimized button should always run the previously selected configuration...
  • Page 23: Changes In 3.0.0 For Eclipse

    Clover 3.1 Documentation CLOV-803 Invalid thread access in CEP Closed CLOV-785 Curious ClassCastException in Coverage Explorer Closed Please also see the core Clover-for-Ant Changelog Changes in 3.0.0 for Eclipse Changes in 3.0.0 for Eclipse 31 March, 2010 This is a major release which includes a new per-test cover viewer and a new dashboard view for Eclipse. JIRA Issues (7 issues) Type...
  • Page 24 Clover 3.1 Documentation Test Contributions (view) Test Run Explorer (view) Workspace (Eclipse setting) Workbench (Eclipse concept) Avg Method Cmp The average method complexity of code in the given context. Block Contexts Refers to common Java coding constructs or idioms such as the body of if statements; static initialiser blocks; or property style methods. These are pre-defined by Clover.
  • Page 25: Clover-For-Eclipse Installation Guide

    Clover 3.1 Documentation Lines Of Code (including comment lines). NC LOC Non-Commented Lines Of Code. Lines of code that contain comments are not counted in this metric, leaving only the actual functioning code itself. Perspective (Eclipse concept) In the Eclipse IDE, each window in the desktop development environment contains one or more perspectives. Perspectives are containers for views and editors which control the content of the navigation user interface and controls.
  • Page 26 Clover 3.1 Documentation resolve this, perform a clean build on your Clover-instrumented classes and select "Yes" when asked to delete coverage data. Installation 1. Installing the plugin You can either install the Clover-for-Eclipse from the live Clover Eclipse update site or from a zipped archive downloaded manually. 1a.
  • Page 27: Installing Clover-For-Eclipse

    Clover 3.1 Documentation Uninstallation In Eclipse 3.3/3.2: To uninstall the plugin, from the Eclipse menu select "Help | Software Updates | Manager Configuration". Find the Clover features in the tree - there should be two: "Clover 2 (for Eclipse 3.2/3.3/3.4)" and "Clover 2 Ant Support (for Eclipse 3.2/3.3/3.4)".
  • Page 28: Installing Older Versions Of Clover-For-Eclipse

    Clover 3.1 Documentation If you agree, click the radio button next to ' I accept the license agreement ' and click the "Next" button. Click "Finish" to start the download process. You will then be prompted to confirm installation of the Clover plugin's various parts. The Clover plugin is not digitally signed so you may encounter a warning to this effect - please ignore this warning.
  • Page 29 Clover 3.1 Documentation You will then be prompted to allow Clover to modify your Eclipse installation's config.ini file. This is required for correct operation of the plugin. If you wish to perform this step yourself you should press "Skip" and the follow the instructions in step 3 below, otherwise click "Proceed".
  • Page 30: Clover-For-Eclipse Upgrade Guide

    Clover 3.1 Documentation 4. Finally, you will be asked if you want to restart Eclipse after installing the plugin. Click "Yes" to restart to complete uninstallation. 2. (Optional) Manually updating config.ini If you selected "Skip" when Clover asked for permission to modify config.ini then you need to make this change yourself to completely remove Clover from your Eclipse installation.
  • Page 31 Clover 3.1 Documentation Overview The Clover Eclipse Plugin allows you to instrument your Java code easily from within the Eclipse Java IDE, and to view your coverage results inside Eclipse. Using the plugin Enabling Clover for your project Clover can be enabled for any of your Java-based Eclipse projects. From the Project Explorer view, right click on your Java project.
  • Page 32 Clover 3.1 Documentation The Clover Coverage Explorer The Coverage Explorer allows you to view and control Clover's instrumentation of your Java projects, and shows you the coverage statistics for each project based on recent test runs or application runs. It is automatically added to the workbench when you enable Clover for your project.
  • Page 33 Clover 3.1 Documentation Clover-for-Eclipse also lets your define your own custom columns for display within the Coverage Explorer tree. While choosing columns in the Column Chooser dialog, click the "New" button to summon the Custom Column Builder dialog. Custom columns must have a name and a valid Clover expression .
  • Page 34 Clover 3.1 Documentation Summary Panel Summary metrics are displayed alongside the tree for the selected project, package, file, class or method in the tree. The following metrics are provided: Structure Packages: The number of packages the project or package root contains Files: The number of files the package, package root or project contains Classes: The number of classes the file, package, package root or project contains Methods: The number of methods the class, file, package, package root or project contains...
  • Page 35 Clover 3.1 Documentation project. Compiled with Clover. Toggles the use of Clover instrumentation when Eclipse compiles the selected Java project. Edit Context Filter... Allows you to edit the block and custom coverage 'contexts' used to help you filter out unwanted coverage data.
  • Page 36 Clover 3.1 Documentation Green Coverage from passing tests. Green Coverage caused incidentally (caused by something other than test methods, e.g. main() methods, test setUp() and tearDown() methods). A different tooltip is presented to show it is incidental. Squiggly Partial branch coverage (caused when only one part of a branch has been covered). Red Lines Yellow Failed test coverage (where coverage has only been caused by one or more failing tests and no passing tests).
  • Page 37 Clover 3.1 Documentation Screenshot: Clover Test Run Explorer Coverage Cloud Reports Coverage cloud report are a great way to work out the classes that form major risks (low coverage but high complexity) to your project and its packages, and also to highlight potential quick wins for increasing the overall project or per-package coverage. The coverage cloud report has two tabs, one tab for the project/package risks cloud and the other for quick wins cloud.
  • Page 38 Clover 3.1 Documentation Bright green (most covered) Dark green (more coverage) Black (around 50% coverage) Dark Red (little coverage) Bright Red (uncovered) The percentage shown in the yellow box is the code coverage for the class currently under the mouse. Right clicking on a package area and selecting the magnify option will then focus the treemap on the package's classes.
  • Page 39: Configuration Options

    Clover 3.1 Documentation Disabling Clover In order to track the code coverage of your projects, Clover must insert special code into your programs at compilation time - called instrumentation - to record this coverage. When Clover is enabled on your projects, Clover will automatically perform this task for every file you compile in the project.
  • Page 40 Clover 3.1 Documentation "At set intervals from a Clover thread" causes Clover to create a separate thread within your application which regularly flushes coverage data to disk. See Flush Policies These options control the compilation of the instrumented source code that Clover generate. Output Folder - This specifies where instrumented classes are placed after compilation.
  • Page 41 Clover 3.1 Documentation Project Properties - Source Files The Source Files tab let you select in detail what exactly should be instrumented. You can select one of the following: A global pattern for including and/or excluding source files. A per-source root selection (including per-source root includes/excludes). This configuration windows allows you to use Ant-style pattern sets.
  • Page 42 Clover 3.1 Documentation Project Properties - Test Classes The Test classes tab lets you select how Clover should look for your tests. You can select from one of the following: A global pattern for including and/or excluding source files. A per-source root selection. None (Clover makes no attempt to look for tests).
  • Page 43 Clover 3.1 Documentation information. This section allows you to specify what the default action should be, and whether Clover should prompt you at all. Coverage visualisation should refresh automatically — If enabled, the plugin will check for updated coverage data at the frequency given below and display and new coverage.
  • Page 44: Generating Reports In Clover-For-Eclipse

    Clover 3.1 Documentation See the Eclipse Plugin FAQ Generating Reports in Clover-for-Eclipse Introduction The Clover-for-Eclipse plugin allows you to generate HTML, PDF or XML reports from one or more Clover-enabled projects in the current workspace. Generating a Report To create a report, select a project or source file then click the left-hand side of the Report Button in Eclipse. The 'Generate Report: Report Format ' dialog opens.
  • Page 45 Clover 3.1 Documentation Select the Source Project A list of available projects will be displayed. To choose one, click the tick box shown next to the desired project and click ' Next '. A dialog box with specific settings for the chosen report type opens. More than one project can be selected (this would be used for instance if the user has multiple related projects or has application code in one project, with test code in another).
  • Page 46 Clover 3.1 Documentation Configure General Settings for the Report Your report can make use of the following settings: report title, output directory location, use current filter settings, include failed coverage, threads allocated, include source, JVM selection. Setting Default Description Include failed coverage True Tests from failed tests are included by default but can be excluded if they wish to discount this as worthy of being reported.
  • Page 47 Clover 3.1 Documentation Configuring a Report Filter Report Filter Configuration is only shown if you choose not to accept default filter settings. This lets you select any of the predefined pre-defined filters or any of the custom method or statement filters you have previously configured. Configuring Your Report JVM Report JVM Configuration is only shown if you chose to fork a separate JVM.
  • Page 48: Launching An Ant Build From Eclipse

    Clover 3.1 Documentation Screenshot: A Generated PDF Report from Clover-for-Eclipse Launching an Ant build from Eclipse Clover-for-Eclipse integrates with Eclipse's built-in Ant support and Ant execution. If you are using Ant with your builds, this makes accessing Ant tasks easier and more convenient launching them from the command line. The Clover-Eclipse Ant support allows users to do the following: Use Clover Ant tasks without declaring a taskdef element.
  • Page 49: Performance Tuning In Clover For Eclipse

    Clover 3.1 Documentation Performance Tuning in Clover for Eclipse Since every project varies in size and speed, Clover may need to be configured to work best for your project. Clover-for-Eclipse Memory Allocation Tracking code coverage for a project, particularly per-test code coverage for large projects can consume a good deal of memory. If things are running too slowly with Clover enabled, consider boosting the memory allocated to your Eclipse installation.
  • Page 50: Test Optimization For Eclipse

    Clover 3.1 Documentation Related Links Clover Performance Tuning for Ant Test Optimization for Eclipse This page explains how to set up Clover's Test Optimization feature in the Eclipse development environment. On this page: Before You Begin Launching Test Optimization Measuring Test Optimization Results Test Optimization Settings Setting Global Preferences Setting Per-launcher Preferences...
  • Page 51 Clover 3.1 Documentation Select an existing launch configuration from the Run Optimized dropdown, OR Screenshot: Launching a Build with Test Optimization from the Drop-Down Menu...
  • Page 52 Clover 3.1 Documentation Create a Run Optimized configuration and execute it from the configuration dialog. Screenshot: Launching a Build with Test Optimization from the Configuration Dialog When the Run Optimized button is used, Clover will run the configuration that was most recently run optimized. Measuring Test Optimization Results When Optimized tests are being run, the JUnit view displays additional info about savings (as shown in the screenshot below).
  • Page 53 Clover 3.1 Documentation This file may be deleted using the Delete Snapshot icon in the Coverage View (next to Delete Coverage Recordings button; you need to select a project first). The ' Delete Coverage Recordings ' button also clears the snapshot file. The Delete Snapshot icon is disabled when the selected project does not have the snapshot file.
  • Page 54 Clover 3.1 Documentation Screenshot: The Run Optimized Drop-Down Menu Allows overriding the workspace settings for single launch config. Use default settings: when set, use the workspace (global) settings. Copy defaults: copy workspace settings to current settings. Configurations Unsuitable For Test Optimization Unfortunately not all configurations are suitable for Test Optimization.
  • Page 55: Clover-For-Idea

    Clover 3.1 Documentation For more information, see this JIRA issue: CEP-297 Limitations with Test Suites Clover does not recognise test suites as entities that should be optimized away. As the result test suites are always run (never optimized). If your test launch configuration includes both test suite and the test case (which is probably an incorrect configuration), then the test case would be run twice (normal behavior) or once (via test suite) when the test case is optimized away.
  • Page 56: Clover-For-Idea Changelog

    Clover 3.1 Documentation Resources and Support Clover-for-IDEA FAQ Forums Support Offline Documentation You can download the Clover documentation in PDF, HTML or XML format. Recently Updated No recent updates found. Clover-for-IDEA Changelog Please also refer to the Clover Core Changelog Clover-for-IDEA Changelog All versions Changes in 3.1.0 for IDEA...
  • Page 57: Changes In 2.3.1-Beta1 For Idea

    Clover 3.1 Documentation Changes in 2.3.1-beta1 for IDEA Changes in 2.3.1-beta1 29 May, 2008 - Build 20080526 This the first public beta release of Clover-for-IDEA based on Clover 2. The full Clover-for-IDEA plugin version number for this build of the plugin is idea7-2.3.1.beta1-v2008052611000000.
  • Page 58: Changes In 2.3.2-Beta4 For Idea

    Clover 3.1 Documentation CIJ-135 Narrowing the Coverage Scope to Test or Application Classes Only in the Coverage view no longer limits information available in other views. CIJ-142 Source file paths are resolved correctly on Windows Changes in 2.3.2-beta4 for IDEA Changes in 2.3.2-beta4 8 September, 2008 - Build 20080908 This is the fourth public beta release of Clover-for-IDEA (based on Clover 2) and is a bug fix release.
  • Page 59: Changes In 2.4.0 For Idea

    Clover 3.1 Documentation number for this build of the plugin is idea7-2.3.2.beta5-v20081022140000. New feature Coverage Cloud report Select In -> Clover (Alt-F1) navigation Major changes Unified Test Explorer window Improved Coverage window Simplified error reporting ( Blame Clover All issues Errors were reported by the JIRA trusted connection.
  • Page 60: Changes In 2.4.1 For Idea

    Clover 3.1 Documentation Changes in 2.4.0 05 November, 2008 - Build 20081105 This is the 2.4.0 release of Clover-for-IDEA (based on Clover 2.4.0). The full Clover-for-IDEA plugin version number for this build of the plugin is idea7-2.4.0-v20081105120000. New feature Failed test coverage is now highlighted 'orange' Major changes Automated loading of coverage data once tests finish Plus various Look &...
  • Page 61: Changes In 2.4.2 For Idea

    Clover 3.1 Documentation CIJ-204 Toggle "Build with Clover" causes Exception CIJ-199 Honor local file encoding setting CIJ-198 Exception occurs while analysing stacktrace with IntelliJ CIJ-192 Idea 8.0 compatibility CIJ-191 Find workaround for wrong file paths in compilation output when TranslatingCompiler is used CIJ-189 IDEA should not rebuild untouched files on make when Clover is enabled Changes in 2.4.2 for IDEA...
  • Page 62: Changes In 2.5.0 For Idea

    Clover 3.1 Documentation Errors were reported by the JIRA trusted connection. APP_UNKNOWN; Unknown Application: {0}; ["confluence:4557196"] JIRA Issues (5 issues) Type Summary CIJ-242 Blame clover for IDEA - It told me to do it CIJ-231 Fatal IDE Error raised by Clover plugin CIJ-225 Assertion failed in Clover on project close CIJ-218...
  • Page 63: Changes In 2.5.1 For Idea

    Clover 3.1 Documentation CIJ-237 Adapt CIJ test optimization work to new optimization implementation in com.cenqua.clover.test.optimization CIJ-236 test optimization fails if a test is deleted CIJ-233 why is the Test Optimization button grayed out? CIJ-232 NPE when i Toggle Build With Clover to True and click 'clean and rebuild now' CIJ-229 Another NPE in 2.4.2 POC CIJ-228 NPE in new 2.4.2 POC CIJ-226 Clover HTML report dialog should check "Include Source"...
  • Page 64: Changes In 2.6.3.2 For Idea

    Clover 3.1 Documentation This is a minor bugfix release. JIRA Issues (3 issues) Summary Priority Status Allow customisation of "Clover could not be initialised. Are you sure you have Clover in the runtime CLOV-454 classpath?" for IDE-specific instructions Closed CLOV-749 NPE in projectClosed() Resolved CLOV-726 Update acknowledgements in CEP / CIJ Closed...
  • Page 65: Clover-For-Idea Faq

    Clover 3.1 Documentation CLOV-1000 Support Intellij 10.5 Please also see the Clover-for-Ant Changelog Clover-for-IDEA FAQ Q: I've run my tests, but coverage information does not show in IDEA A: If you do not have "Auto Coverage Refresh" enabled, you will need to press the Refresh Button in the Clover Tool Window. Q: Where does IDEA write its log file? A: On Mac OS X IDEA will write its log file to ~/Library/Caches/IntelliJIDEA70/log/idea.log...
  • Page 66 Clover 3.1 Documentation Installing the Plugin Manually You can download the Clover-for-IDEA plugin from Atlassian Downloads and install it manually as follows: Shut down any running instances of IDEA. Remove any previous versions of the the Clover-for-IDEA plugin .jar file from the following plugin installation locations: IDEA_HOME/plugins (all platforms) IDEA_HOME/config/plugins (all platforms excepting Mac OS X) USER_HOME/Library/Application\ Support/IntelliJIDEA70 (Mac OS X only)
  • Page 67: Clover-For-Idea Upgrade Guide

    Clover 3.1 Documentation Known Issues If you are using the Maven build tool, you should avoid using the same IntelliJ output directory as Maven does. As Maven uses the directories, avoid specifying these ones. The location for IntelliJ target/classes target/test-classes clover.db should also be distinct from that used by Maven.
  • Page 68 Clover 3.1 Documentation Viewing Coverage Results Coverage Treemap Reports Setting Context Filters Using the Tool Window Showing Coverage with Annotations Test Run Explorer Unique Actions in Test Run Explorer Select In -> Clover (Alt-F1 menu) Configuration Options Compilation Options Initstring Flush Policy Instrumentation Rebuild Policy...
  • Page 69 Clover 3.1 Documentation highlight covered code (in green) and code with no coverage (in red), only highlight code with no coverage, turn code coverage highlighting off. this enables little gray and green clovers in package explorer These indicate the toggled state of the exclusion annotation. When option is selected only coverage from passed unit tests contributes to the coverage percentage.
  • Page 70 Clover 3.1 Documentation Coverage Treemap Reports The coverage treemap report allows simultaneous comparison of classes and package by complexity and by code coverage. The treemap is divided by package (labelled) and then further divided by class (unlabelled). The size of the package or class indicates its complexity (larger squares indicate great complexity, while smaller squares indicate less complexity).
  • Page 71 Clover 3.1 Documentation Using the Tool Window The lower portion of the Tool Window contains various Metrics for the currently selected node in the browser: Screenshot: Clover Tool Window Summary Showing Coverage with Annotations In addition, the plugin can annotate the Java code with the coverage information. This can be turned on by pressing the Show Coverage toolbar button.
  • Page 72 Clover 3.1 Documentation If you do not have "Auto Coverage Refresh" enabled, you will need to press the Refresh Button in the Main Toolbar or the Clover Tool Window to see the updated coverage information. If a source file has changed since a Clover build, then a warning will be displayed alerting you to fact that the inline coverage information may not be accurate.
  • Page 73 Clover 3.1 Documentation Initstring This section controls where the Clover coverage database will be stored. Select 'Automatic' to have Clover manage this location for you (relative to your project directory). Select 'User Specified' to nominate the path to the Clover coverage database. This is useful if you want to use the plugin in conjunction with an Ant build that already sets the location of the Clover coverage database.
  • Page 74 Clover 3.1 Documentation Rebuild Policy The Clover database becomes obsolete after certain operations (such as toggling Build with Clover ). The Rebuild Policy setting allows defining the plugin's behavior in the case of such an event. Ask: The plugin will show a dialog window asking for confirmation. Rebuild Immediately: The plugin will rebuild the project automatically, without asking the user.
  • Page 75 Clover 3.1 Documentation Allows you to customize where coverage data is displayed within the IntelliJ IDE. Gutter marks appear in the left hand gutter of the Java Source Editor. Source highlights appear directly over your source code. Shortcut marks appear in the right hand gutter and allow you to navigate directly to uncovered regions of code.
  • Page 76: Clover-For-Idea Auto-Updates

    Clover 3.1 Documentation Custom Contexts This allow you to define custom contexts to ignore when viewing coverage information. Working with regexp filters: to Create, Delete or Copy respectively the selected filter. All new and edited regexp filters will be shown in 'blue', indicating that they are currently unavailable. To make a new/edited filter active, you need to delete the existing coverage database using the button and rebuild your project/module.
  • Page 77: Performance Tuning In Clover For Idea

    Clover 3.1 Documentation When an update to Clover-for-IDEA is available, a blinking Clover icon appears on the IDEA status bar. You can click this icon, which will produce a dialog window showing new version information. You can also choose to upgrade Clover-for-IDEA directly from that window. Screenshot: New Version Notification Window in IDEA Performance Tuning in Clover for IDEA Boosting Allocated Memory...
  • Page 78 Clover 3.1 Documentation To establish Test Optimization in Clover-for-IDEA, carry out one of the following actions: Right-click on a folder or package containing test classes and select ' Run Optimized ', OR Screenshot: Launching a Build with Test Optimization from the Context Menu Select an existing launch configuration in the Run Configurations drop-down menu and press...
  • Page 79 Clover 3.1 Documentation Measuring Test Optimization Results When Optimized tests are being run, Clover displays additional info about savings (as shown in the screenshot below). Screenshot: Pop-up Notification of Time Savings With Test Optimization After Optimized tests run, Clover saves a snapshot file with coverage information that is used to optimize the following test runs. This file may be deleted using the Delete Snapshot icon in the Clover Toolbar.
  • Page 80 Clover 3.1 Documentation Setting Per-launcher Preferences Screenshot: Running Optimized Configurations Test Optimization specific configuration options for specific JUnit configurations. The defaults copied to new configurations may be set using Edit Defaults button. Configurations Unsuitable For Test Optimization Unfortunately not all configurations are suitable for Test Optimization. Please see the following points for specific details. Limitations with Test Suites Clover does not recognise test suites as entities that should be optimized away.
  • Page 81: Clover-For-Ant

    Clover 3.1 Documentation 3. If your test case is run twice, or not optimized at all; Clover does not support test suites. Make sure you don't try to run one, launch test cases directly ( CIJ-249 Clover-for-Ant Clover-for-Ant Documentation What is Clover-for-Ant? Clover-for-Ant integrates the industry-leading code coverage tool, Atlassian Clover with the Apache Ant build automation tool.
  • Page 82 Clover 3.1 Documentation Changes in 2.4.3 for Ant Changes in 2.4.2 for Ant Changes in 2.4.0 for Ant Changes in 2.3.2 for Ant Changes in 2.3.1 for Ant Changes in 2.3.0 for Ant Changes in 2.2.1 for Ant Changes in 2.2.0 for Ant Changes in 2.1.0 for Ant Changes in 2.0.3 for Ant Changes in 2.0.2 for Ant...
  • Page 83 Clover 3.1 Documentation CLOV-902 clover maven plugin not playing well with jaxb CLOV-787 new option 'copyExcludedFiles' in maven-clover2-plugin CLOV-793 TreeMap on Dashboard includes Test Code. treemap.html does not. CLOV-873 Make coverage tooltips more meaningful for Groovy constructs CLOV-804 Enabling Clover on a project sometimes fails if .clover already exists CLOV-803 Invalid thread access in CEP CLOV-807 Copying groovy files before instrumentation collapses directory structure CLOV-848 Field initialisers have no coverage...
  • Page 84: Changes In 2.0.0 For Ant

    Clover 3.1 Documentation CLOV-842 Add a Dashboard screen to the Eclipse Plugin CLOV-781 In line per-test coverage viewer for Eclipse CLOV-868 Failed to syntax high light groovy code CLOV-851 Grails Test fail due to Clover Instrumentation CLOV-809 FileNotFoundExceptions when initstring is more than one path deep CLOV-761 Implement a Groovy source renderer CLOV-907 Grails plugin fails to install on windows CLOV-730 Add Groovy support to Clover...
  • Page 85: Changes In 2.0.3 For Ant

    Clover 3.1 Documentation CLOV-71 - Improved handling of annotations on instrumented test methods CLOV-73 - Correctly instrument tests with return values Improvements CLOV-74 - New "returntype" attribute added to the element in <testmethod/> <testsources> CLOV-77 - Allow qualified names to be turned off during instrumentation java.lang CLOV-87 - Reduced memory footprint when loading the Clover database...
  • Page 86: Changes In 2.0A3 For Ant

    Clover 3.1 Documentation Changes in 2.0a2 9 December, 2006 New Features [CCD-353] - new task. <clover-instr> Bugs [CCD-355] - instrumentation results in IOException on Windows. Changes in 2.0a3 for Ant Changes in 2.0a3 22 December, 2006 New Features [CCD-325] - preliminary implementation of Dashboard summary report. Improvements [CCD-306] - report how many test methods were detected.
  • Page 87: Changes In 2.0B1 For Ant

    Clover 3.1 Documentation 5 May, 2007 New Features [CCD-395] - coverage on test classes is now reported separately to coverage of application classes. You can also optionally nominate filesets that define your test classes. See the new {{ <testsources/> }}nested element. This also applies to Clover history points.
  • Page 88: Changes In 2.0B2 For Ant

    Clover 3.1 Documentation Changes in 2.0b2 for Ant Changes in 2.0b2 21 September, 2007 This is a minor release of Clover2 for Ant and contains mainly report time performance based improvements. It is important to note that the tasks will use 2 threads as of this release when <...
  • Page 89: Changes In 2.2.1 For Ant

    Clover 3.1 Documentation Improvements CLOV-89 - Percentage of Filtered Code displayed in reports CLOV-174 - Clover command line option to ignore contexts when generating coverage reports CLOV-202 - Source line numbers are now hyperlinked CLOV-205 - <columns/> element is now an Ant Type - i.e. can be referenced via refid CLOV-180 - <testsources/>...
  • Page 90: Changes In 2.3.1 For Ant

    Clover 3.1 Documentation CLOV-228 work in IE7 [Atlassian] Pellow Fixed 2008 2008 [Atlassian] Closed Nick Inline Help Popup doesn't Geoff Crain Apr 08, Apr 30, CLOV-227 Pellow Fixed work in IE7 [Atlassian] 2008 2008 Closed [Atlassian] Clover history reports should Nick Pellow Andy Cannot...
  • Page 91: Changes In 2.4.0 For Ant

    Clover 3.1 Documentation Brendan Test Source missing if test Nick Pellow Jun 12, Jul 02, CLOV-281 Fixed Humphreys methods are empty [Atlassian] 2008 2008 Resolved [Atlassian] file element in XML report Nick Pellow Nick Pellow Jun 09, Jun 25, CLOV-280 should use the fully Fixed [Atlassian]...
  • Page 92: Changes In 2.4.2 For Ant

    Clover 3.1 Documentation CLOV-320 Allow custom contexts to be specified on the CloverInstr CLI CLOV-354 ANSI color logging CLOV-353 Plugin re-ordering classpath CLOV-318 Automatically create history directory CLOV-341 option for XmlReporter command line tool --filter CLOV-329 NPE thrown from getJSONSrcFileLines under certain conditions CLOV-300 Provide package and project level JSON CLOV-279...
  • Page 93: Changes In 2.4.3 For Ant

    Clover 3.1 Documentation Changes in 2.4.3 for Ant Clover-for-Ant 2.4.3 9 March, 2009 Clover 2.4.3 for Ant is an improvement and bug fix release which adds the ability to generate historical JSONP data and performance improvements. New Features CLOV-300 - Option to generate historical JSONP data. Improvements CLOV-401 - Don't fail the build if snapshot file is updated against a different clover.db.
  • Page 94: Changes In 2.5.1 For Ant

    Clover 3.1 Documentation CLOV-361 Clover plugin is not available in IDEA 8 Milestone 1. CLOV-362 Investigate clover-report performance improvements. CLOV-391 Guard to ensure there is only one reconnection thread. CLOV-408 Investigate coverage of assignment in a boolean expression. CLOV-447 MethodInfo's throws and params fields are quite often empty arrays, use flyweight to reduce size of model in memory. CLOV-475 Better debug logging when loading coverage.
  • Page 95 Clover 3.1 Documentation CLOV-706 IDEA: Very long pause when Clover is enabled and a test is run - on projects with many modules Resolved CLOV-704 Move historical movers and added files to top of historical report. Closed CLOV-702 Fix warning from GSON library Closed CLOV-698 Update copyright dates in About dialog Resolved...
  • Page 96 Clover 3.1 Documentation CLOV-637 Improve Clover Hudson Integration - new auto-integrate strategy Resolved CLOV-630 Run Optimized button should always run the previously selected configuration Resolved CLOV-628 Ant 1.6 confuses AndSpec and OrSpec for AndSelector and OrSelector Closed CLOV-625 change the update frequency to 1d Closed CLOV-624 reword 'test coverage' to 'test code' or Coverage: App|Test Closed...
  • Page 97: Changes In 2.6.2 For Ant

    Clover 3.1 Documentation CLOV-549 Create an EAP site for CEP Closed CLOV-548 Investigate how to redesign the Clover database format to support quick instrumentation Closed Set up a continuous performance monitoring environment for Clover with a minimal set of performance CLOV-547 tests Closed...
  • Page 98: Changes In 2.6.3 For Ant

    Clover 3.1 Documentation JIRA Issues (17 issues) Summary Priority Status CLOV-764 NPE in TestCaseInfo when generating reports Resolved CLOV-757 Movers section of the historical report don't respect to and from attributes of historical report element Closed CLOV-755 Clover Ant Integration should pass the -noinput command line flag to prevent hangs on windows Closed CLOV-754 Log4J warnings logged if log4j on the classpath Closed...
  • Page 99: Changes In 3.0.0 For Ant

    Clover 3.1 Documentation CLOV-809 FileNotFoundExceptions when initstring is more than one path deep Closed CLOV-804 Enabling Clover on a project sometimes fails if .clover already exists Closed CLOV-803 Invalid thread access in CEP Closed CLOV-800 NPE on CloverDatabase.resolve() in certain circumstances Closed CLOV-795 clover.pertest.coverage=diff is broken Closed...
  • Page 100 Clover 3.1 Documentation CLOV-776 Integrate with Grails CLOV-843 Support ternary and elvis operators as branches CLOV-782 Upgrade IDEA plugin to use new journaling database CLOV-876 Grover should respect <clover-setup enabled="false"/> CLOV-784 Fix embedded crowd build to work with maven+clover plugin CLOV-908 Investigate warnings output by maven-clover2-plugin with grover enabled CLOV-902 clover maven plugin not playing well with jaxb CLOV-787 new option 'copyExcludedFiles' in maven-clover2-plugin...
  • Page 101: Changes In 3.1.0 For Ant

    Clover 3.1 Documentation CLOV-894 JUnit test results parsing seems broken when enclosing test suite class can't be found CLOV-890 Implement support for Groovy in Maven CLOV-887 Add sanity check in grover that avoids instrumenting already-instrumented ASTs CLOV-870 Error rendering groovy enums CLOV-901 Eclipse per-test coverage viewer CLOV-931 Create XSD for XML result format CLOV-842 Add a Dashboard screen to the Eclipse Plugin...
  • Page 102: Installation Options

    Clover 3.1 Documentation Clover-for-Ant Upgrade Guide Clover Release Notes Installation options For the quickest and easiest installation options, see the QuickStart Guide instead of this page. 1. Download Clover Download Clover from http://www.atlassian.com/software/clover/CloverDownloadCenter.jspa Unzip the Clover distribution into a directory. This directory will be referred to as CLOVER_HOME in this guide.
  • Page 103: Installing From Build.xml

    Clover 3.1 Documentation Alternatively, you can add to the system environment variable before running Ant. For information CLOVER_HOME/clover.jar CLASSPATH about setting this variable, please consult your Operating System documentation. NEXT STEP Clover for Ant Best Practices Installing from build.xml This is the recommended method of installing Clover. Adding Clover to your build is done by adding the following to your buildfile (e.g.
  • Page 104: Clover-For-Ant User's Guide

    Clover 3.1 Documentation 2. Obtain and install a Clover license When you run Clover, output similar to the following will appear: [clover] Clover Version x.x, built on ... [clover] Loaded from: c:/ant/lib/clover.jar 3. Delete any existing Coverage database The Clover database is created at the location specified in the attribute of initstring <clover-setup>...
  • Page 105: Quickstart Guide

    Clover 3.1 Documentation 1. QuickStart Guide Getting started with Clover-for-Ant This section shows you how to quickly get Clover integrated into your build. Clover instrumentation and reporting are highly configurable so later sections of this manual will detail available configuration options and typical usage scenarios. Unless otherwise indicated, all configuration options throughout this User's Guide apply to both Java and Groovy.
  • Page 106: Clover For Ant Best Practices

    Clover 3.1 Documentation <target name="clover.xml"> <clover-report> <current outfile="coverage.xml"> <format type="xml"/> </current> </clover-report> </target> OR, for simple emacs-style reporting to the console, try: <target name="clover.log"> <clover-log/> </target> 2.4 Add to the runtime classpath for your tests. How you do this depends on how you run your tests. For tests executed via the clover.jar task, add a element:...
  • Page 107: Clover-For-Ant Two Line Integration

    Clover 3.1 Documentation Note If you want to specify the explicity, it is strongly recommended that you give Clover its own direct initstring directory, because a Coverage run can result in many files being written to the database. Use the <clover-clean> task Once you have generated the reports or history points you require from a Coverage run, use to delete the <...
  • Page 108 Clover 3.1 Documentation The following targets will then be available to you: These are available also by running `ant -projecthelp`. Target Name Description clover.all Runs clover.clean, with.clover, test, clover.report from a single target. clover.clean Deletes the clover database and the ${clover.dest} directory.
  • Page 109: Test Optimization Quick Start Guide

    Clover 3.1 Documentation Need more information? Find it in the Clover QuickStart Guide Test Optimization Quick Start Guide This page contains the basic steps for adding Clover's Test Optimization to an existing Ant configuration. Follow the steps in this document to set up Clover's Test Optimization, which allows targeted testing of only the code which has changed since the last build.
  • Page 110: Using Clover Interactively

    Clover 3.1 Documentation <junit ...> <batchtest fork="true" todir="${test.results.dir}/results"> <clover-optimized-testset snapshotfile="${clover.snapshot.file}"> <fileset dir="src/tests" includes="${test.includes}" excludes="${test.excludes}"/> </clover-optimized-testset> </batchtest> </junit> For Ant 1.6, modify any fileset in the batchtest element and add a clover-optimized-selector element: <junit ...> <batchtest fork="true" todir="${test.results.dir}/results"> <fileset dir="src/tests" includes="${test.includes}" excludes="${test.excludes}"/> </batchtest>...
  • Page 111: Using Clover In Automated Builds

    Clover 3.1 Documentation <clover-setup> <files includes="**/plugins/cruncher/**, **/plugins/muncher/**"/> </clover-setup> The includes could be set using an Ant property so that individual developers can specify includes on the command line: <property name="coverage.includes" value="**"/> <clover-setup> <files includes="${coverage.includes}"/> </clover-setup> Developers can then use a command line like the following for Java code: ant build -Dcoverage.includes=java/**/foo/*.java And for Groovy code: ant build -Dcoverage.includes=groovy/**/foo/*.groovy...
  • Page 112 Clover 3.1 Documentation In this example, the task is used to generate source-level coverage reports in HTML format that can be published < clover-html-report > for viewing by the whole team: <target name="clover.report" depends="with.clover"> <clover-html-report outdir="clover_html"/> </target> Executive summary coverage reports In this example, the task is used to generate summary reports in PDF format, suitable for email or audit purposes.
  • Page 113: Understanding Reports

    Clover 3.1 Documentation 4. Understanding Reports 'Current' Report — 'Current' Clover reports display graphical and numerical data relating to the most recent coverage data collected for the project. 'Historical' Report — 'Historical' reports display graphical and numerical data relating to sets of coverage data collected over time the project.
  • Page 114 Clover 3.1 Documentation The left-most column shows line numbers. The second column shows the number of times a particular line has been executed during the test run. As you can see, lines 15-17 have been run 156 times by the JUnit tests, whereas line 28 has only been run twice. If a line is never executed or has only been partially executed, the entire line of code will be highlighted in red.
  • Page 115: Historical' Report

    Clover 3.1 Documentation If any of the lines shaded red contained a bug, they may never be detected because the tests as they are don't test those parts of the code. 'Historical' Report 'Historical' reports display graphical and numerical data relating to sets of coverage data collected over time for the project.
  • Page 116 Clover 3.1 Documentation The section 'Classes added' allows you to monitor the coverage of newly added classes. Screenshot: Classes Added and Movers The final section, 'Movers' , displays classes that have increased or decreased in coverage by more than a specified percentage point threshold over a particular time interval, the default being one percentage point over the two latest history points.
  • Page 117 Clover 3.1 Documentation Screenshot: Historical Covered Versus Uncovered Elements The tutorial discusses how you can customise many aspects of the historical report...
  • Page 118: About 'Coverage Clouds

    Clover 3.1 Documentation About 'Coverage Clouds' Tag Cloud or 'weighted list' is a way of visually representing information. In Clover, ' Coverage Clouds ' provide an instant overview of your entire project and individual packages, enabling you to identify areas of your code that pose the highest risks or shortcomings.
  • Page 119: Using The Clover Dashboard

    Clover 3.1 Documentation Using the Clover Dashboard In Clover's HTML reports, the dashboard page provides a summary of the coverage and unit test results, as well as suggested entry points for the rest of the report. In Clover 2.2, two new charts have been added to the Dashboard. Class Coverage Distribution chart shows a breakdown of how many classes have a given percentage of coverage.
  • Page 120: Configuring Reports

    Clover 3.1 Documentation When a test failure occurs, the exception that caused the failure is captured and analysed by Clover. At each source line that propagated the exception, Clover places an icon. Clicking on this icon provides a popup window showing all exceptions that were propagated from this line, and the full stack trace for that exception.
  • Page 121: Extracting Coverage Data Programmatically

    Clover 3.1 Documentation Extracting Coverage Data programmatically Sharing Report Formats — You can share report formats across a number of reports. This allows you to standardise on a set of report formats and use these for all of your reports. Unit Test Results and Per-Test Coverage —...
  • Page 122: Unit Test Results And Per-Test Coverage

    Clover 3.1 Documentation Sharing Report Formats You can share report formats across a number of reports. This allows you to standardise on a set of report formats and use these for all of your reports. Standalone format elements are created using the type.
  • Page 123 Clover 3.1 Documentation You must ensure that all your test classes are included for Clover instrumentation. To enable Clover instrumentation of your source code, use the task. <clover-setup> This allows Clover to specially mark test methods to enable per-test coverage reporting. The Clover instrumenter automatically detects test methods for Junit 3.x, Junit 4.x and TestNG.
  • Page 124: Using Coverage Contexts

    Clover 3.1 Documentation Supply the <testresults> element at report time. If the element is specified, and similar tasks will use these results instead of those collected <testresults> <clover-report> by Clover. Clover's test result collection may also be switched off via the attribute on dontRecordTestResults <clover-setup>...
  • Page 125 Clover 3.1 Documentation A method signature includes all annotations, modifiers (public, static, final etc), the return type, the method name, parameter types and names, the throws clause and exceptions. Note When matching method signatures against context regexps, whitespace is normalised and comments are ignored. You can define your own method contexts via the sub-element of , or via the configuration panel of...
  • Page 126: Using Spans

    Clover 3.1 Documentation In some cases you may not be interested in the coverage of statements inside catch blocks. To filter them, you can use Clover's predefined context to exclude statements inside catch blocks from a coverage report: catch <clover-report> <current outfile="clover_html">...
  • Page 127: Ant Task Reference

    Clover 3.1 Documentation second 3 seconds minute 5 minute 7 min, 11m hour 4 hours 7 days 365d week 4 weeks month 5.6 months 24mo year 100 years If no time unit is provided, the default unit of "days" is used. A numeric value must always be provided or an exception will be thrown. Numeric values may be fractional (e.g.
  • Page 128 Clover 3.1 Documentation clover-check Description task tests project/package code coverage against criteria, optionally failing the build if the criteria are not met. This <clover-check> task needs to be run after coverage has been recorded. Parameters Attribute Description Required conditionalTarget The target percentage conditional coverage for the At least one of target methodTarget project.
  • Page 129 Clover 3.1 Documentation methodTarget The target percentage method coverage for At least one of target methodTarget statementTarget the package. is required. conditionalTarget name The name of the package. Either (but not both) of is required. name regex regex Regular expression to match package Either (but not both) of is required.
  • Page 130: Clover-Clean

    Clover 3.1 Documentation <clover-check target="80%" conditionalTarget="90%" filter="catch"> <package name="com.acme.killerapp.core" target="70%"/> <package name="com.acme.killerapp.ai" target="40%"/> </clover-check> As previous example, but also ensures that the project conditional coverage is at least 90%. <clover-check> <package regex="com.acme.killerapp.core.*" target="70%"/> </clover-check> Tests if coverage for and all subpackages is at least 70%. com.acme.killerapp.core clover-clean Description...
  • Page 131: Clover-Historypoint

    Clover 3.1 Documentation The following targets will be available: Target Name Description clover.all Runs clover.clean, with.clover, test, clover.report from a single target. clover.clean Deletes the clover database and the directory. clover.current Generates an HTML and XML report to using clover.report Same as clover.current, however a history report will also be created, using the historypoints in clover.save-history Saves a history point to with.clover...
  • Page 132 Clover 3.1 Documentation initstring of the coverage database. No; if not specified here, Clover will look initstring in the default location ( ). If you have ${basedir}/.clover specified an on the initstring < task, you must ensure clover-setup > that is called prior to <...
  • Page 133: Clover-Html-Report

    Clover 3.1 Documentation <clover-historypoint historydir="history" filter="toString" includeFailedTestCoverage="false" property="clover.historypoint.path"> </clover-historypoint> Records a history point that excludes all test coverage that is attributed to a failed test; will contain the clover.historypoint.path absolute file path of the history point that was created. <clover-historypoint historyDir="clover-historical"> <testsources dir="src"...
  • Page 134: Clover-Instr

    Clover 3.1 Documentation <clover-html-report outdir="build/clover/report" historydir="clover/historypoints" title="MyProject Coverage"/> This will generate a report in the " " directory. A history point will be created in the " " build/clover/report clover/historypoints directory, and all history points in that directory will be used to generate the historical section of the report. The report will be titled " ".
  • Page 135 Clover 3.1 Documentation relative This controls whether the parameter is treated as a relative path or not. No; defaults to ' initstring false srcdir The directory of source code to instrument. Yes, unless a nested <fileset> element is used. source The source level to process source files at.
  • Page 136 Clover 3.1 Documentation regexp A Perl 5 Regexp that defines the context. This regexp should match statements you wish to include in this context. Yes. Note that when statements are tested against this regexp, whitespace is normalised and comments are ignored. <testsources>...
  • Page 137: Clover-Log

    Clover 3.1 Documentation Examples <clover-instr srcdir="src" destdir="instr"/> Produce an instrumented copy of all source files in the into the . The Clover registry is at the default location. srcdir destdir <clover-instr destdir="instr"/> <fileset dir="src"> <include name="**/*.java"/> </fileset> </clover-instr> This example achieves the same as the first example, but using an embedded fileset. <clover-instr destdir="instr"/>...
  • Page 138: Clover-Merge

    Clover 3.1 Documentation filter comma or space separated list of contexts to ignore when calculating coverage. See Using Coverage Contexts span Specifies how far back in time to include No; defaults includes "all coverage data found". coverage recordings from since the last Clover build.
  • Page 139: Clover-Pdf-Report

    Clover 3.1 Documentation task merges several Clover databases into one, to allow for combined reports to be generated. The resultant <clover-merge> database can be used with reporting tasks, such as , using the parameter. < clover-report > < clover-log > initstring Parameters Attribute...
  • Page 140: Clover-Report

    Clover 3.1 Documentation Parameters Attribute Description Required outfile The filename to write the report to. Yes. initstring The path to the Clover database. If not specified, Clover will use the set by a previous execution of initstring < in the current build sequence. Otherwise, the default database location will be used. clover-setup >...
  • Page 141 Clover 3.1 Documentation Examples Using Custom Reports There are a number of examples of how to use the custom report elements on this page, as well as reference material: Current Report Configuration Examples Customising Columns Examples Linked Reports Example Historical Report Configuration Examples Column Name Reference Table Clover Expression Language <clover-report>...
  • Page 142 Clover 3.1 Documentation maxTestsPerFile Specifies the maximum number of tests (ranked by coverage contribution) to display No; unlimited if not on a source file report page. This parameter can be used to reduce the size of specified or -1. reports for projects with very large numbers of tests. numThreads The number of threads to start when generating an HTML report.
  • Page 143 Clover 3.1 Documentation cases. For more details please see ' Advanced Usage <historical> Generates a historical coverage report. Specify the report format using a nested Format element (see below). Valid formats are HTML or PDF. The default format is HTML. Contents of the historical report are optionally controlled by nested elements. See Nested elements of <historical>...
  • Page 144 Clover 3.1 Documentation Attribute Description Required title The title to use for the chart. logscale Use a log scale for the y axis. No; default is set to 'true'. xLabel The x label to use. yLabel The x label to use. width The width of the chart image.
  • Page 145 Clover 3.1 Documentation Example: <totalStatements> You could add totalStatements to <movers> with the following code. <movers> <columns> <totalStatements/> </columns> </movers> No more than one additional column can be added to <movers>. <added> <added> displays new classes for the given column. Parameters for <added>...
  • Page 146 Clover 3.1 Documentation orderBy Specify how to order coverage tables. This attribute has no effect on XML format. Valid values are: No; defaults to PcCoveredAsc. — Alpabetical. Alpha — Percent total coverage, ascending. PcCoveredAsc — Percent total coverage, descending. PcCoveredDesc —...
  • Page 147 Clover 3.1 Documentation coveredElements The total number of covered elements (branches + statements) in the project. raw bar % longbar coveredMethods The amount of covered methods. raw bar % longbar coveredStatements The amount of covered statements. raw bar % longbar expression The body of this element will be evaluated as an arithmetic expression.
  • Page 148 Clover 3.1 Documentation scope Controls at which level in the report the column will appear. The scope attribute can be one of: "package", "class" or "method". If omitted, the column will be used at every level in the report. Note that only the following columns support the scope attribute: expression complexity complexityDensity coveredXXX uncoveredXXX totalXXX...
  • Page 149 Clover 3.1 Documentation <clover-report> <current outfile="report-current" title="Coverage"> <fileset dir="src/main/java"> <exclude name="**/*Blah.java"/> </fileset> <format srclevel="true" type="html"/> </current> </clover-report> Generates a HTML clover report and excludes all *Blah.java classes from the report. <clover-report> <current outfile="clover_html" title="Util Coverage"> <format type="html" orderBy="ElementsCoveredAsc"/> <testsources dir="src/test" includes="\**/*.java"/> </current>...
  • Page 150 Clover 3.1 Documentation <clover-report> <current outfile="report-current" title="Coverage"> <format type="html"/> <columns> <coveredMethods format="bar" min="75"/> <coveredStatements format="%"/> <coveredBranches format="raw"/> </columns> </current> </clover-report> Generates a HTML report that will only include a bar chart showing the percentage of methods covered, the actual percentage of statements covered and the actual number of branches covered.
  • Page 151 Clover 3.1 Documentation <clover-report> <historical outfile="report.pdf" title="My Project" historyDir="clover_history"> <overview/> <movers threshold="5%" range="20" interval="2w"/> <format type="pdf"/> </historical> </clover-report> Generates a PDF historical report that only includes an overview section (showing summary coverage at the last history point) and a movers table showing classes that have a code coverage delta of greater than +- 5% over the two weeks prior to the last history point.
  • Page 152 Clover 3.1 Documentation <!-- Define the callback function before including the java.js for the file you wish to process. --> <script type="text/javascript"> function processClover(obj) { alert(obj.id); alert(obj.stats.CoveredElements); alert(obj.stats.Complexity); alert(obj.lines); </script> <!-- Now, include as many java.js files as you wish. Each will call your "processClover" callback function above.
  • Page 153: Clover-Setup

    Clover 3.1 Documentation Basic Clover Confluence Integration Embedding Clover Data into a Confluence Page There is currently no native support for embedding Clover in Confluence. Many use cases can be achieved however by using the {iframe} macro The following are examples of displaying live Clover data directly in Confluence. Clover Dashboard {iframe:src=http://downloads.atlassian.com/software/clover/samples/lucene/dashboard.html|width=100%|height=500px}{i Project Risks Coverage Cloud...
  • Page 154 Clover 3.1 Documentation <clover-setup> < distributedCoverage /> < files /> < fileset /> < methodcontext /> < statementcontext /> < testsources > advanced users only < testclass > < testmethod /> </ testclass > </ testsources > </clover-setup> Parameters All attributes of the element support Java.
  • Page 155 Clover 3.1 Documentation It is important to note that the Clover compiler adapter still picks up its settings from the set of Clover Ant properties. The <clover-setup> task provides a convenient method to set these properties. This means that builds that use the Clover 1.0 property set will continue to operate as expected.
  • Page 156 Clover 3.1 Documentation This element does not support Groovy. Parameters Attribute Description Required name The name for this context. Must be unique, and not be one of the reserved context names (see Using Coverage Yes. Contexts regexp A Perl 5 Regexp that defines the context. This regexp should match statements you wish to include in this context. Yes.
  • Page 157 Clover 3.1 Documentation <testmethod> can be used to perform more fine grained detection of test methods. Parameters Attribute Description Required name A regex on which to match the test method's name. annotation A regex on which to match the test method's annotation. A regex on which to match the test method's javadoc tags.
  • Page 158: Clover-Snapshot

    Clover 3.1 Documentation Specifying a delegate compiler Clover provides the optional "clovercompiler" attribute to allow specification of the java compiler to delegate to once instrumentation is completed. The attribute accepts the same values "compiler" attribute of the Ant Javac Task <clover-setup clovercompiler="jikes"/>...
  • Page 159: Ant Type Reference

    Clover 3.1 Documentation Defines a custom span of "3m" (three minutes) used in generating the snapshot file used for Test Optimization. 7. Ant Type Reference Clover Ant Types <clover-format Creates standalone format elements which can then be used across a number of reports. >...
  • Page 160: Clover-Optimized-Selector

    Clover 3.1 Documentation orderBy Specify how to order coverage tables. This attribute has no effect on XML format. Valid values are: No; defaults to PcCoveredAsc. — Alpabetical. Alpha — Percent total coverage, ascending. PcCoveredAsc — Percent total coverage, descending. PcCoveredDesc —...
  • Page 161: Clover-Optimized-Testset

    Clover 3.1 Documentation <junit ...> <batchtest todir="${outdir}/${testresultsprefix}" fork="true"> <fileset dir="${test.location}" includes="**/*Test.java"> <clover-optimized-selector fullrunevery="${max.optimized.builds}" enabled="${do.optimize.tests}"/> </fileset> <formatter type="xml"/> <formatter type="plain"/> </batchtest> </junit> clover-optimized-testset Description type is an Ant 1.7-only feature that is designed to be used within JUnit and Ant's <clover-optimized-testset> <batchtest/>...
  • Page 162: Clover Performance Tuning

    Clover 3.1 Documentation Working with Restricted Security Environments Clover Performance Tuning This page contains instructions on how to tune Clover's performance when running your builds and measuring code coverage. On this page: Configure 'Unique Coverage' Tracking Set Instrumentation to "method level" (when using Test Optimization) Runtime Performance Settings Related Links Configure 'Unique Coverage' Tracking...
  • Page 163: Using A Flush Policy

    Clover 3.1 Documentation Registry file Filename: clover.db Description: The Registry file contains information about all of the classes that have been instrumented by Clover. This file does not contain any actual coverage recording data. Lifecycle: The Registry file is written during the instrumentation process.
  • Page 164: Using Source Directives

    Clover 3.1 Documentation interval The policy flushes as per the directed policy, and also at a maximum rate determined by the interval set at interval instrumentation time (see the attribute on ). The mode is a 'passive' mode in flushinterval <...
  • Page 165 Clover 3.1 Documentation Collecting Per-Test Coverage from Distributed Builds Enabling or Disabling Distributed Coverage at Runtime Collecting Overall Coverage from Distributed Builds The first step in setting up coverage from distributed builds is to configure Clover for overall coverage reporting. Step 1: Understanding the Clover 'initstring' At build time, Clover constructs a registry of your source code, and writes it to a file at the location specified in the Clover initialisation string ( ).
  • Page 166 Clover 3.1 Documentation Enabling or Disabling Distributed Coverage at Runtime Clover's Distributed Coverage feature is enabled at runtime by making use of command-line options. This can be done without the need for re-instrumentation or compilation of source files. Enabling Distributed Coverage Distributed coverage can be enabled via setting this System property: -Dclover.distributed.coverage=ON This will enable distributed coverage with default settings.
  • Page 167: Working With Restricted Security Environments

    Clover 3.1 Documentation Setting the System Properties in the Ant JUnit Task <junit fork="true" forkmode="once" showoutput="true" printsummary="true"> <sysproperty key="clover.server" value="true"/> <sysproperty key="clover.distributed.coverage" value="ON"/> </junit> Setting a System Property in the Java task that starts the WebServer The JVM running your webserver also requires the property set to clover.distributed.coverage <java jar="${jetty.jar}"...
  • Page 168: Clover Target Reference

    Clover 3.1 Documentation Recommended Permissions Clover requires access to the Java system properties for runtime configurations, as well as read write access to areas of the file system to read the Clover coverage database and to write coverage information. Clover also uses a shutdown hook to ensure that it flushes any as yet unflushed coverage information to disk when Java exits.
  • Page 169 Clover 3.1 Documentation Property name Description Options Dependency test.target Defines the name of a custom target to run the tests. inheritrefs (TRUE/FALSE) clover.clean, with.clover Example: ant clover.all -Dtest.target=run.tests In the example above, we are specifying the property. This is fed another value, ( shown as ).
  • Page 170: Clover-For-Maven 2 And 3

    Clover 3.1 Documentation clover.project.historydir A path location, where history points are stored. None None test.target Defines the name of a custom target to run the tests. inheritrefs clover.clean, (TRUE/FALSE) with.clover clover.span A time interval defining the time span to use when creating None None historical reports...
  • Page 171: About Clover-For-Maven 2 And 3

    Clover 3.1 Documentation Using Clover for Maven 2 and 3 User's Guide Installation & Configuration Guide Test Optimization Quick Start Guide Resources and Support Clover Forums Support.atlassian.com FAQ page Offline Documentation You can download the Clover documentation in PDF, HTML or XML format. Recently Updated No recent updates found.
  • Page 172: Clover-For-Maven 2 And 3 Changelog

    Clover 3.1 Documentation svn co https://studio.plugins.atlassian.com/svn/CLMVN/trunk Installing the Plugin The plugin can then be built, tested and installed via: mvn clean install Running Integration Tests To run the integration tests, use: mvn clean integration-test -Pintegration-tests Submitting a Patch To submit a patch: Make and test the change in your local subversion work area Create a jira issue against the Maven Clover 2 and 3 Plugin...
  • Page 173: Changes In 2.1 For Maven 2 (Plugin Version 3.7)

    Clover 3.1 Documentation Changes in 2.0.2 for Maven 2 (plugin version 3.3) Changes in the maven-clover-plugin version 3.3 01 November, 2007 This release updates the version of Clover used to 2.0.2. Clover 2.0.2 includes these bug fixes and enhancements. JIRA Issues (0 issues) Type Summary...
  • Page 174: Changes In 2.3.0 For Maven 2

    Clover 3.1 Documentation might happen. Surefire usage is no longer supported, from maven-clover-plugin 4.0 onwards. Changes in 2.3.0 for Maven 2 Changes in the Clover 2.3.0 for Maven 2 plugin 12 June, 2008 The Clover 2.3.0 for Maven 2 plugin adds a number of improvements and bug fixes. Upgrading the Maven 2 plugin There are specific steps required for upgrading from a previous version of the plugin: see the [Upgrade Guide]...
  • Page 175: Changes In 2.3.2 For Maven 2

    Clover 3.1 Documentation 2. 'Clover:' must be expressed as 'Clover2:' Wherever ' Clover: ' is used, you must change it to ' Clover2: ' to take advantage of the new version. Read the documentation for instructions on how to install or upgrade. Note that a full clean build is required. Changes in 2.3.2 for Maven 2 Changes in the Clover 2.3.2 for Maven 2 plugin 15 July, 2008...
  • Page 176: Changes In 2.4.3 For Maven 2

    Clover 3.1 Documentation Changes in 2.4.2 for Maven 2 Changes in the Clover 2.4.2 for Maven 2 plugin 2 December, 2008 Clover 2.4.2 for Maven 2 is a point release which fixes some minor issues. Issue key Summary CLMVN-86 Build fails if snapshot directory is not available. CLMVN-86 Use the artifactId for the report title, not the project name.
  • Page 177: Changes In 2.6.0 For Maven 2

    Clover 3.1 Documentation CLMVN-97 Artifacts with the same name (but different groupIds) being resolved incorrectly. CLMVN-93 Test run in different module does not update coverage. CLMVN-111 clover2:merge goal does not setup the licensing correctly. Atlassian recognizes Henri Tremblay , who submitted a patch for Clover-for-Maven 2, which was reviewed and integrated into the product. Changes in 2.6.0 for Maven 2 Changes in the Clover 2.6.0 for Maven 2 plugin 9 September, 2009...
  • Page 178: Changes In 3.1.0 For Maven 2 And 3

    Clover 3.1 Documentation CLMVN-24 Clover gives me a coverage of -100%? Changes in 3.1.0 for Maven 2 and 3 Changes in the Clover 3.1.0 for Maven 2 and 3 plugin 31 May, 2010 Clover 3.1.0 for Maven 2 and 3 is a release that adds support for Java 1.7 language features. JIRA Issues (1 issues) Type...
  • Page 179: Clover-For-Maven 2 And 3 Quick Start Guide

    Clover 3.1 Documentation Clover-for-Maven 2 and 3 Quick Start Guide To get started with Clover-for-Maven 2 and 3, carry out the following steps. The page Clover-for-Maven 2 and 3 User's Guide does not exist. For more general instructions, see the Clover-for-Maven 2 and 3 User's Guide Next Steps Once you have Clover fully integrated with your build, you can move on to...
  • Page 180 Clover 3.1 Documentation Maven Site Docs For documentation presented in the standard Maven format, see the Maven Site Docs On this page: Basic Usage Checking a Coverage Goal Ratcheting Up Coverage Configuring the Plugin Controlling which Source Files are Instrumented Excluding your Tests from Instrumentation Controlling the level of Instrumentation Configuring Contexts...
  • Page 181 Clover 3.1 Documentation mvn clover2:setup test clover2:aggregate clover2:clover This will create a coverage report, which will be created in this directory: target/site/clover Clover should now be fully set up for basic operation. For more license configuration options, see the FAQ pages Checking a Coverage Goal You can check that your test coverage has reached a certain threshold, and fail the build if it has not by adding a tag to...
  • Page 182 Clover 3.1 Documentation You can define the level that Clover will instrument to (and the respective performance overhead). Valid values are ' method ' level (low overhead) or ' statement ' level (high overhead). The default setting is ' statement Setting this to ' method ' greatly reduces the performance overhead of running Clover, however limited or no reporting is...
  • Page 183 Clover 3.1 Documentation You can set the Clover Flush Policy and interval: <configuration> <flushPolicy>threaded</flushPolicy> <flushInterval>5000</flushInterval> </configuration> Choosing Report Formats target generates an HTML report by default. You can use the generateHtml generatePdf generateXml clover2:clover configuration elements to choose which report formats should be produced: <configuration>...
  • Page 184 Clover 3.1 Documentation It is now possible to define an external clover report descriptor file, the same way one can define a site.xml descriptor file. The descriptor file is basically a stripped down Ant file which will be run to produce the reports. All options available in clover-report can be specified.
  • Page 185 Clover 3.1 Documentation <resolveReportDescriptor>true</resolveReportDescriptor> in the element for the maven-clover2-plugin in your pom.xml <configuration> The descriptor should be deployed using the "clover-report" classifier. For example: mvn deploy:deploy-file -DgroupId=my.group.id -DartifactId=my-artifact-id -Dversion=X.X -Dclassifier=clover-report \ -Dpackaging=xml -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Properties for Custom Reports A custom clover report descriptor can now access the standard Maven 2 and 3 properties.
  • Page 186 Clover 3.1 Documentation <plugins> <plugin> <groupId>org.codehaus.groovy.maven</groupId> <artifactId>gmaven-plugin</artifactId> <version>1.0-rc-5</version> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.6.2</version> </dependency> </dependencies> <executions> <execution> <goals> <goal>generateStubs</goal> <goal>compile</goal> <goal>generateTestStubs</goal> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> </plugins> If you use cross-compilation with Groovy code, please refer to the Cross Compilation using Groovy on the Clover for Maven 2 and 3 Best Practices...
  • Page 187 Clover 3.1 Documentation <project> <build> <plugins> <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-clover2-plugin</artifactId> <configuration> </configuration> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>instrument</goal> </goals> </execution> </executions> </plugin> </plugins> </build> To include aggregation of child modules: <project> <build> <plugins> <plugin> <executions> <execution> <id>main</id> <phase>verify</phase> <goals> <goal>instrument</goal> <goal>aggregate</goal> </goals> </execution>...
  • Page 188: Clover For Maven 2 And 3 Best Practices

    Clover 3.1 Documentation .m2/settings.xml <pluginGroups> <pluginGroup>com.atlassian.maven.plugins</pluginGroup> </pluginGroups> to tell Maven where to look for the plugin. This step is not needed if you wish to only run Clover via the pom.xml You can then invoke Clover from the command line like so: mvn clover2:setup test clover2:aggregate clover2:clover The Clover 2 'instrument' goal ( clover2:instrument...
  • Page 189 Clover 3.1 Documentation mvn deploy -Pclover.optimize then you will be deploying class files that have been instrumented by Clover. Running the Clover 2 goals Directly Add a new build plan with the following command line: mvn clover2:setup verify clover2:snapshot Test Optimization on the Desktop Running Clover's test optimization locally is very advantageous.
  • Page 190 Clover 3.1 Documentation WARNING: It is not recommended to deploy your Clover instrumented classes to an external Maven repository. clover2:setup will automatically bind itself to the 'process-sources' phase if defined in the goals list of the plugin's executions. Cross Compilation using Groovy If you are using cross-compilation with Groovy code, you should ensure that the goal runs before the maven-clover2-plugin:setup...
  • Page 191 Clover 3.1 Documentation <profile> <id>clover.optimize</id> <build> <plugins> <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-clover2-plugin</artifactId> <version>${cloverVersion}</version> <configuration> <snapshot>${user.home}/.clover/${groupId}-${artifactId}/clover.snapshot</snapshot> </configuration> <executions> <execution> <id>clover</id> <goals> <goal>setup</goal> <goal>optimize</goal> <goal>snapshot</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> Clover Optimize, Report, Log and Check Profile <profile> <id>clover.all</id> <build> <plugins> <plugin>...
  • Page 192: Using Distributed Per-Test Coverage With Maven 2 And 3

    Clover 3.1 Documentation Overview of Test Optimization Test Optimization Technical Details Test Optimization Quick Start for Ant Test Optimization Quick Start for Maven 2 and 3 Using Distributed Per-test Coverage with Maven 2 and 3 This page contains instructions on how to collect per-test coverage from a set of functional tests, which run in multiple JVMs (Java Virtual Machines).
  • Page 193: Using Test Optimization With Clover-For-Maven 2 And 3

    Clover 3.1 Documentation Step 1: Activate the Distributed Coverage Feature To add the element to the configuration section, apply the following code: <distributedCoverage/> maven-clover2-plugin <configuration> <distributedCoverage/> </configuration> This will enable distributed per-test coverage to be collected. Clover running in the JVM that hosts the tests will start a TCP server to do so. By default, it listens on localhost:1198 element takes the following nested elements:...
  • Page 194 Clover 3.1 Documentation mvn com.atlassian.maven.plugins:maven-clover2-plugin:setup com.atlassian.maven.plugins:maven-clover2-plugin:optimize test com.atlassian.maven.plugins:maven-clover2-plugin:snapshot By default, the snapshot file gets saved to ${basedir}/. . This file is needed to optimize subsequent builds. It can clover/clover.snapshot be deleted by running the clover2:clean goal. You can also specify an alternative location using -Dmaven.clover.snaphost=/path/to/clover.snapshot .
  • Page 195: Clover-For-Grails

    Clover 3.1 Documentation followed by Screenshot: Clover-for-Maven Console Output 4 If a source file is modified in any way (including whitespace changes), and you re-run the build, only TestCases that cover the modified file will be run. By default, the same snapshot file is updated for 10 consecutive builds. On the 10th build, the snapshot file is deleted and recreated. You can adjust this setting via the fullRunEvery option on the clover2:optimize goal.
  • Page 196: Clover-For-Grails Installation And Upgrade Guide

    Clover 3.1 Documentation No recent updates found. Clover-for-Grails Installation and Upgrade Guide This page provides instructions for all available Clover-for-Grails plugin installation and upgrade options. Overview The documentation below assumes that you have already installed Grails and have configured your environment variable to point to PATH directory of your Grails installation.
  • Page 197 Clover 3.1 Documentation Change directory to the root of your Grails project. For example, if you installed the sample Grails project 'petclinic' that is bundled with Grails, you would change directory into <Grails Installation Directory>/samples/petclinic Run the following command, which downloads the Clover-for-Grails plugin from the web address and install it into your Grails project: grails install-plugin http://plugins.grails.org/grails-clover/tags/RELEASE_x_y_z/grails-clover-x.y.z.zip...
  • Page 198: Clover-For-Grails Quick Start Guide

    Clover 3.1 Documentation Move or copy the file into this Notes about this option: clover.license location: The root directory of your Grails project. This option installs the Clover license file to this Grails project only. You will need to install this file into each of your other Grails projects with the Grails-for-Clover plugin For e.g.
  • Page 199 Clover 3.1 Documentation Adding the Clover option to this Grails command makes the report open in a browser window immediately -clover.view after generation. If you omit this command line option, Clover will generate a report that you can then open manually. Passing the location of your file to the command line...
  • Page 200 Clover 3.1 Documentation // Example setuptask closure that will be invoked to configure clover. // Any Clover initialisation tasks should be defined here. // All attributes on the ant clover-setup task, which are // supported by your source code, can be defined here. setuptask = { ant, binding, plugin ->...
  • Page 201 Clover 3.1 Documentation clover { // reports.dir defines the location of your Clover report output // within your Grails project. reports.dir = "build/clover/report" // The reporttask closure is invoked after all tests have run. reporttask = { ant, binding, plugin -> ant.mkdir(dir: "${clover.reports.dir}") ant.'clover-report' { ant.current(outfile: "${clover.reports.dir}/clover.pdf", summary: true) {...
  • Page 202: Clover Command Line Tools

    Clover 3.1 Documentation Clover Command Line Tools Clover provides a set of Command line tools for integration with legacy build systems such as Make, or custom build scripts. If you use Jakarta Ant to build your project, a set of Clover Ant Tasks provides easier Ant integration.
  • Page 203: Clovermerge

    Clover 3.1 Documentation Options -e, --encoding Specify the file encoding for source files. If not specified, the platform default encoding is used. <encoding> -f, --flushinterval Tell Clover how often to flush coverage data when using either "interval" or "threaded" flushpolicy. Value in <int>...
  • Page 204: Consolereporter

    Clover 3.1 Documentation Parameters Parameter Description Required -i, --initstring <file> Clover initstring. Clover initstring. This is the path where the new merged database will be written. Yes. Options Option Description Enable debug logging. --debug -s, --span Specifies the span to use when reading subsequent databases to be merged. This option can be specified more than once interval and applies to all databases specified after the option, or until another span in specified If specified, any existing database specified by -i will be included in the merge.
  • Page 205: Htmlreporter

    Clover 3.1 Documentation -i, --initstring <file> The initstring of the coverage database. Options -a, --alwaysreport Forces a report to be generated, even if there is no coverage data. Defaults to ' ', i.e. a report with no coverage false will abort generation. -t, --title <string>...
  • Page 206: Pdfreporter

    Clover 3.1 Documentation -b, --hidebars Don't render coverage bars. Don't colour syntax-highlighted source — smaller HTML output. -c, --orderby Comparator to use when listing packages and classes. Default is PcCoveredAsc. <compname> Valid values are: Alpha — Alpabetical. PcCoveredAsc — Percent total coverage, ascending. PcCoveredDesc —...
  • Page 207 Clover 3.1 Documentation Usage java com.cenqua.clover.reporters.pdf.PDFReporter [OPTIONS] PARAMS Params -i, --initstring <file> The initstring of the coverage database. -o, --outputfile <file> The file to write the report to. Options -a, --alwaysreport Forces a report to be generated, even if there is no coverage data. Defaults to ' ', i.e.
  • Page 208: Xmlreporter

    Clover 3.1 Documentation java com.cenqua.clover.reporters.pdf.PDFReporter -c ElementsCoveredAsc -t "My Coverage" -i clover.db -o coverage.pdf Produces the same report as above, but includes a report title, and orders lists by total elements covered rather than percentage covered. XmlReporter Produces an XML report of Code Coverage for the given coverage database. Usage java com.cenqua.clover.reporters.xml.XMLReporter [OPTIONS] PARAMS Parameters...
  • Page 209: Clover-For-Maven 1

    Clover 3.1 Documentation Produce the same report as above, but include source-level coverage information, and a report title. Clover-for-Maven 1 Clover-for-Maven 1 Documentation What is Clover-for-Maven 1? Clover-for-Maven 1 integrates the industry-leading code coverage tool, Atlassian Clover with the Apache Maven build automation tool.
  • Page 210: Clover-For-Maven 1 Faq

    Clover 3.1 Documentation 9 March 2009 This is a minor bug-fix release with one major item: CLMVNONE-12 Fix related to forking. See the current features of Clover 2 for an overview of Clover 2 for Ant's current capabilities. Also see the Clover Release Notes Changelog for Clover-for-Maven 1 version 2.4.2 6 November 2008...
  • Page 211: Clover-For-Maven 1 Upgrade Guide

    Clover 3.1 Documentation 1. Downloading the Plugin To download Clover-for-Maven 1, run the following command at the console: maven plugin:download -Dversion=2.4.2 -DgroupId=maven -DartifactId=maven-clover-plugin 2. Acquiring the Dependencies from Atlassian To acquire the dependencies from Atlassian, run the following command at the console: maven clover:on -Dmaven.repo.remote=https://maven.atlassian.com/repository/public 3.
  • Page 212: Maven Clover Plugin Properties

    Clover 3.1 Documentation maven clover:on war This will instrument your source code. Then you'll run any goal that tests your artifacts. For example, in the case of a WAR you can HttpUnit/HtmlUnit to run functional tests. The test of your artifact will fill the Clover database with data. Finally you'll run to generate the reports.
  • Page 213: Registering A Clover Report

    Clover 3.1 Documentation maven.clover.check.targets Comma-separated list of test coverage % that you wish to check for each packages specified by maven.clover.check.packages when clover:check is called. maven.clover.context.block.names Comma-separated list of Clover-defined block contexts to filter from the Clover coverage report. Example: maven.clover.context.block.names = static, method.
  • Page 214: Using Test Optimization With Clover-For-Maven 1

    Clover 3.1 Documentation <reports> <report>maven-clover-plugin</report> [...] </reports> Clover Goals Goal Description clover This is the default goal. It compiles the project code with Clover, executes the unit tests and generate Clover reports by calling the clover:report goal. clover:test Compiles the project code with Clover and executes the unit tests. clover:test-single Execute a single unit test and view the test coverage result directly using the Clover Swing viewer.
  • Page 215: Clover 3.1 Release Notes

    Clover 3.1 Documentation Release Notes Clover Release Summary Clover 3.1 Release Notes — Clover 3.1 adds support for Java 1.7 language constructs, Maven 3, Groovy 1.7 & 1.8, Grails 1.3.7, Eclipse 3.6 and Intellij IDEA 10.5. Clover 3.0 Release Notes —...
  • Page 216 Clover 3.1 Documentation Upgrading to Clover 3.1 Clover 3.1 can be downloaded from the Clover Download Centre . Before upgrading, please refer to the relevant documentation: Clover-for-Ant Changelog Clover-for-Maven 2 and 3 Changelog Clover-for-IDEA Changelog Clover-for-Eclipse Changelog Highlights of Clover 3.1 Java 1.7 Support Clover 3.1 now provides support for the Java 1.7 language features...
  • Page 217 Clover 3.1 Documentation Screenshot: Clover Filtering Specified Groovy Methods Clover-for-Grails Plugin for Grails 1.3.7 Clover 3.1 incorporates a plugin for the Grails web application development framework supporting Grails version 1.3.7. Grails project developers can test their Groovy code using Clover to generate coverage reports. The Clover-for-Grails plugin is very easy to install and upgrade, with multiple installation options that can be issued from a single Grails command.
  • Page 218 Clover 3.1 Documentation Support for Eclipse 3.6 and 3.7 RC The Clover-for-Eclipse plugin now supports Eclipse 3.6 and has been tested and is known to work with 3.7 RC builds too. Eclipse does not yet support Java 1.7 language features but Clover-for-Eclipse is ready once it does. Support for Intellij 10.5 The Clover-for-IDEA plugin now supports Intellij 10.5 including support for Java 1.7 language features.
  • Page 219: Clover 3.0 Release Notes

    Clover 3.1 Documentation Bug fixes and improvements See the changelog for details. Clover 3.0 Release Notes 31 March 2010 Atlassian presents Clover 3.0 Clover 3.0 is a major release which adds Groovy support for Ant, Maven 2 and Grails. We also offer the new Clover-for-Grails plugin that allows you to use Clover's code coverage capabilities directly inside your Grails project.
  • Page 220 Clover 3.1 Documentation Upgrading to Clover 2.6 Clover 2.6 can be downloaded from the Clover Download Centre . Before upgrading, please refer to the relevant documentation: Clover-for-Ant Changelog Clover-for-Maven 2 and 3 Changelog Clover-for-IDEA Changelog Clover-for-Eclipse Changelog Highlights of Clover 3.0 Groovy Support for Ant, Maven 2 and Grails Clover 3.0 Ant and Maven 2 plugins now provide support for Groovy...
  • Page 221 Clover 3.1 Documentation New Clover-for-Grails Plugin Clover 3.0 now incorporates a new plugin for the Grails web application development framework . Grails project developers can now test their Groovy code using Clover to generate coverage reports. The Clover-for-Grails plugin is very easy to install and upgrade, with multiple installation options that can be issued from a single Grails command.
  • Page 222 Clover 3.1 Documentation Per-Test Coverage Viewer for Eclipse The Clover-for-Eclipse plugin includes a new inline per-test coverage viewer. Hovering over the gutter now displays a pop-up with a list of tests that hit that line. Clicking on a test will take you directly to the test source code. Screenshot: New Clover-for-Eclipse per-test coverage pop-up New Dashboard View in Eclipse For the first time, the Clover Report Dashboard is now available in Eclipse!
  • Page 223: Clover 2.6 Release Notes

    Clover 3.1 Documentation The existing 'Money Demo' tutorial (located in ) has been updated with additional Groovy code for Ant and Maven CLOVER_HOME/tutorial 2. The Ant ( ) and Maven 2 ( ) tutorial solution files contain examples of Groovy integration. build_completed.xml pom_completed.xml For Ant builds, your Groovy code will automatically be compiled if the...
  • Page 224 Clover 3.1 Documentation Upgrading to Clover 2.6 Clover 2.6 can be downloaded from the Clover Download Centre . Before upgrading, please refer to the relevant documentation: Clover-for-Ant Changelog Clover-for-Maven 2 and 3 Changelog Clover-for-IDEA Changelog Clover-for-Eclipse Changelog Highlights of Clover 2.6 New Clover Editions Clover licences now add an affordable Desktop Edition to the line-up.
  • Page 225: Clover 2.5 Release Notes

    Clover 3.1 Documentation spot not only poorly tested, large classes but also identify clusters of untested code. Read more: Treemap Charts New API for Optimizing Tests Programatically This new addition to Clover will allow you to take advantage of Clover's Test Optimization feature, only running those tests for which code has changed, even if you are using a testing framework other than Junit or TestNG.
  • Page 226: Clover 2.4 Release Notes

    Clover 3.1 Documentation Upgrading to Clover 2.5 Clover 2.5 can be downloaded from the Clover Download Centre . Before upgrading, please refer to the relevant documentation: Clover-for-Ant Changelog Clover-for-Maven 2 and 3 Changelog Clover-for-IDEA Changelog Clover-for-Eclipse Changelog Highlights of Clover 2.5 Test Optimization in Clover for Eclipse and IDEA Clover's much-lauded feature called Test Optimization is now available in Clover for Eclipse and Clover for IntelliJ IDEA, bringing the ability to run only the tests that have been affected by changes to program code.
  • Page 227 Clover 3.1 Documentation Clover 2.4 is a major release with a significant new feature called Test Optimization, along with a number of improvements and bug fixes. Upgrading to Clover 2.4 is free for all customers with active Clover software maintenance at date of launch. Highlights of Clover 2.4: Test Optimization Easier Integration...
  • Page 228: Clover 2.3 Release Notes

    Clover 3.1 Documentation Reporting Improvements New columns have been added: PercentageCoveredContribution PercentageUncoveredContribution - showing the percentage of coverage a particular class contributes to the overall project. Also the new FilteredElements column shows the amount of code that has been filtered from a coverage report. Custom contexts, allowing arbitrary blocks of code to be filtered from reports, are now supported by the maven-clover2-plugin.
  • Page 229: Clover 2.2 Release Notes

    Clover 3.1 Documentation New options for Movers report More options are now available for generation of the Clover 'movers' report. Users can now define arbitrary metrics to detect movers. Read more New <added> tag This new tag is for viewing coverage of newly added classes. It's now possible to keep track of classes newly added to your project, via the historical report.
  • Page 230 Clover 3.1 Documentation New visualisations for Dashboard Clover 2.2 adds new histogram charts, which show coverage distribution across all your project's classes. A new scatter plot shows complexity against coverage, making outlying classes easier to spot. A sparkline version of the histogram chart is also included. Stack trace navigation in reports This feature will help you diagnose test failures and the lines of code where the failure occurred.
  • Page 231: Clover 2.1 Release Notes

    Clover 3.1 Documentation Don't go backwards Clover can now be configured to warn you (and optionally fail your build) when your coverage drops. In this way, you can ensure that your code coverage is maintained or improves over time. Clover 2.1 Release Notes 14 February 2008 Atlassian Software Systems presents Clover 2.1 Clover 2.1 allows you to tailor your coverage reporting even more closely to your needs.
  • Page 232: Clover 2.0 Release Notes

    Clover 3.1 Documentation Per-package coverage clouds Coverage clouds are now available at the package level, allowing you to compare classes within a specific package. This is specifically aimed at large projects, which have multiple developers working in different packages. Historical charting New charts have been added to historical reports.
  • Page 233 Clover 3.1 Documentation Upgrading to Clover 2.0 is free for all customers with active Clover software maintenance at date of launch. Highlights of Clover 2.0: Coverage by test case Test results integrated with reports 'Coverage Cloud' reports Linked, cross-referenced reports Context filters Method-level metrics Sortable columns...
  • Page 234: Clover Release Summary

    Clover 3.1 Documentation Context filters Source code excluded by a context filter is now highlighted grey and project, package and file level statistics may be viewed with filtering either on or off. Method-level metrics Metrics at the method level are displayed both inline and in each class summary section. Sortable columns All tables in Clover 2 reports are client-side sortable.
  • Page 235: Clover Tutorials

    Clover 3.1 Documentation Test Optimization in Clover for Eclipse and IDEA Distributed Per-Test Coverage Performance Improvements Clover 2.4 (5-Nov-2008) Test Optimization Easier Integration Reporting Improvements Clover-for-IDEA final release Clover 2.2 (10-Apr-2008) New visualisations for Dashboard Stack trace navigation in reports Better cross-referencing in reports Configure Clover to warn you or fail your build when your coverage drops Clover 2.1 (14-Feb-08)
  • Page 236: Tutorial - Using Clover With Ant And Junit

    Clover 3.1 Documentation <profiles> <profile> <id>myprofile</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <maven.clover.licenseLocation>/path/to/clover.license</maven.clover.licenseLocation> </properties> </profile> </profiles> If you are not finished, carry on with the Clover-for-Maven configuration . Enjoy using Clover. Installing a licence for the Clover-for-Eclipse plugin You need a valid Clover license file to run Clover. You can obtain a free 30 day evaluation license or purchase a commercial license http://www.atlassian.com Open your valid trial, purchased or Open Source license file for Clover.
  • Page 237: Part 1 - Measuring Coverage

    Clover 3.1 Documentation Once you have Ant installed and the Clover for Ant package have been downloaded, you are ready to progress to Part 1 - Measuring Coverage in the tutorial. Part 1 - Measuring Coverage Welcome to the Clover-for-Ant tutorial. This document will walk you through the process of integrating Clover with an Ant build, gradually exploring Clover's more advanced code coverage features along the way.
  • Page 238 Clover 3.1 Documentation $ ant test.run Buildfile: build.xml test: [junit] Running MoneyTest [junit] Tests run: 22, Failures: 0, Errors: 0, Time elapsed: 0.052 sec BUILD SUCCESSFUL Total time: 1 second This shows that all the tests have been run and have passed. We have now compiled the Money library, and run tests against it.
  • Page 239 Clover 3.1 Documentation <target name="clean" > <delete dir="build"/> <clover-clean/> </target> Once you have made these changes, save the file. We will add some more Clover targets later to perform coverage reporting, build.xml but first we will re-compile the Money library with Clover and re-run the tests to obtain coverage data. Step 3.
  • Page 240 Clover 3.1 Documentation <target name="clover.report" depends="with.clover"> <clover-html-report outdir="clover_html" title="Clover Demo"/> </target> task is a simplified version of the task. As no attribute has been specified, < clover-html-report > < clover-report > historydir it uses the current coverage data. Historical reports, which show the progress of coverage over the life of the project, are discussed later in this tutorial (see Part 2 - Historical Reporting ).
  • Page 241: Part 2 - Historical Reporting

    Clover 3.1 Documentation Finally, the following test needs to be added: public void testMoneyEqualsZero() { assertTrue(!f0USD.equals(null)); IMoney equalMoney = new Money(0, "CHF"); assertTrue(f0USD.equals(equalMoney)); After these amendments have been made, clean and then compile (by running ) and run the ant clean with.clover code.compile tests again (by running ), then re-generate the HTML report (by running ).
  • Page 242 Clover 3.1 Documentation Ensure that the source code has been instrumented, and the tests run, by using the commands ant clean with.clover respectively. code.compile ant test.run Run the command . Output should be similar to the following: ant record.point $ ant record.point Buildfile: build.xml with.clover: record.point:...
  • Page 243 Clover 3.1 Documentation public void testMoneyBagEqualsZero() { assertTrue(!fMB3.equals(null)); IMoney expected = MoneyBag.create(new Money(0, "CHF"), new Money(0, "USD")); assertTrue(fMB3.equals(expected)); After making the above changes, reinstrument and test your code by running ant clean with.clover code.compile respectively. Then record a new history point by running .
  • Page 244 Clover 3.1 Documentation $ ant hist.report Buildfile: build.xml with.clover: hist.report: [clover-report] Clover Version 1.x, built on ... [clover-report] Writing report to 'C:\clover\tutorial\historical.pdf' [clover-report] Merged results from 2 coverage recordings. [clover-report] Done. Processed 1 packages. [clover-report] Writing historical report to 'C:\clover\tutorial\historical.pdf' [clover-report] Read 3 history points.
  • Page 245: Part 3 - Automating Coverage Checks

    Clover 3.1 Documentation Chart Configuration Clover presents flexible charting configuration, allowing you to present information exactly as you like it. The element allows you to <chart> define a custom chart and fill it with specific data with the element. <columns> <target name="hist.report.select"...
  • Page 246 Clover 3.1 Documentation Ensure that you have current Clover coverage data so that you can check the coverage percentage for your project. Clover coverage data is generated as described in Part 1 of the Tutorial. Add the task to your build by specifying a target similar to the following: <...
  • Page 247: Part 4 - Test Optimization Tutorial

    Clover 3.1 Documentation task also allows you to specify the desired percentage covered for different packages, which is useful if you have < clover-check > certain packages that have more or less stringent coverage requirements than the rest of the project. This is done by adding nested ' ' elements like the following: package <target name="clover.check.packages"...
  • Page 248 Clover 3.1 Documentation <property name="clover.jar" value="${user.home}/clover.jar"/> <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/> <taskdef resource="cloverjunitlib.xml" classpath="${clover.jar}"/> <clover-env/> 2. Choosing a Location for the Snapshot File Test Optimization uses the concept of a ' snapshot ' file. This is a file that records information about the previous build, as a point of comparison.
  • Page 249 Clover 3.1 Documentation Finally, we will build our project, creating the essential Clover 'snapshot' file. Next, we will edit one of the Java files in the 'Money' project, commenting out one of the unit tests. When we run the Test Optimized build a second time, Clover will compare the snapshot file against the new coverage database and then run targeted tests which incorporate only those files which have changed, (which in this case will be only one, the Java file that we edited).
  • Page 250: Glossary

    Clover 3.1 Documentation Now having changed a file in the project, we will run the same Ant tasks again. ant with.clover test.run clover.snapshot Clover will detect that the source file has changed, rebuilding and only running the tests for that file specifically. We can see this illustrated in the console output: test.run: [junit] Clover estimates saving around 3 seconds on this optimized test run.
  • Page 251: Coverage

    Clover 3.1 Documentation code coverage Code coverage (or 'test coverage', or just 'coverage') is a measurement, usually expressed as a percentage, of how much of your source-code is being executed by your test suite. In general, a code coverage system collects information about the running program, then combines that with source information to generate a report on the test suite's code coverage.
  • Page 252: Clover Faq

    Clover 3.1 Documentation test coverage Code coverage (or 'test coverage', or just 'coverage') is a measurement, usually expressed as a percentage, of how much of your source-code is being executed by your test suite. In general, a code coverage system collects information about the running program, then combines that with source information to generate a report on the test suite's code coverage.
  • Page 253 Clover 3.1 Documentation Clover FAQ Answers to frequently asked questions about configuring and using Clover: Top Questions For Evaluators Can Clover Optimise My Tests? Can I Exclude Files From Clover Coverage Reports? Can The Clover Reports Be Configured? Does Clover Depend On JUnit? How Does Clover Benefit Developers? What Are The Limitations Of Code Coverage? What Build Tools Does Clover Integrate With?
  • Page 254: Concepts & Usage Faq

    Clover 3.1 Documentation Do you have a question, or need help with Clover? Please create a support request Concepts & Usage FAQ Clover Concepts & Usage FAQ Can I create a Clover Report on Server A if I have the clover.db which I generated on Server B? Does Clover depend on JUnit? —...
  • Page 255: Does Clover Support The New Language Features In Jdk1.5

    Clover 3.1 Documentation Maven website for details. Q: Does Clover 2 integrate with Maven? Atlassian has brought Maven plugin development in-house. The Maven plugin remains open source. See the instructions for using Clover with Maven 2 Does Clover support the new language features in JDK1.5? Q: Does Clover support the new language features in JDK1.5? Clover fully supports all JDK1.5 language features.
  • Page 256: What Are The Limitations Of Code Coverage

    Clover 3.1 Documentation 2.1 Open Tools/Libraries 2.2 Click "New Library..." and name it "Clover" 2.3 Add to the new library. CLOVER_HOME/lib/clover.jar 3. Use Add JAR/Folder to add to the project classpaths CLOVER_HOME/lib/clover.jar 3.1 Open Project/Properties... 3.2 In Libraries add the Clover library to the Compile, Run, Compile tests, Run tests classpaths 4.
  • Page 257: What Is Code Coverage Analysis

    Clover 3.1 Documentation name that the tool's author gained while writing Clover ("Mr Cover Lover"). What is Code Coverage Analysis? Q: What is Code Coverage Analysis? Code Coverage Analysis is the process of discovering code within a program that is not being exercised by test cases. This information can then be used to improve the test suite, either by adding tests or modifying existing tests to increase coverage.
  • Page 258: Why Does Clover Use Source Code Instrumentation

    Clover 3.1 Documentation Clover uses Ant patternsets to manage the includes and excludes specified in the task. By default Ant does not < clover-setup > pass these patternsets to the sub-builds. If you are using a master-build/sub-build arrangement, with compilation occuring in the sub-builds and done in the master-build, <...
  • Page 259: Is Clover 2 Supported On Ibm's Rad 7

    Clover 3.1 Documentation Q: I only need instrumented classes for unit testing and I don't want to risk publishing them to my production environment. How can I do this with Clover? Clover supports writing both instrumented and uninstrumented class files to different directories during a build. To enable the feature, right click on your project and select properties, select Clover, select Compilation tab, select "User specified folder"...
  • Page 260: How To Keep Clover Reports Between Builds

    Clover 3.1 Documentation <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <executions> <execution> <id>attach-instrumented-jar</id> <phase>verify</phase> <goals> <goal>attach-artifact</goal> </goals> <configuration> <artifacts> <artifact> <file> ${basedir}/target/clover/${project.artifactId}-${project.version}-clover.jar </file> <type>jar</type> <classifier>clovered</classifier> </artifact> </artifacts> </configuration> </execution> </executions> </plugin> A subsequent 'mvn deploy' will lead to a deployment of the instrumented jar, the 'Clovered' version as a secondary artifact along with the non-instrumented (original lifecycle's) primary artifact.
  • Page 261: Preparing Multi-Module Projects For Remote Deployment With Clover-For-Maven 2

    Clover 3.1 Documentation .m2/settings.xml <pluginGroups> <pluginGroup>com.atlassian.maven.plugins</pluginGroup> </pluginGroups> <profiles> <profile> <id>myprofile</id> <activation> <activeByDefault>true</activeByDefault> </activation> <pluginRepositories> <pluginRepository> <releases><enabled>true</enabled></releases> <id>atlassian-m2-repository</id> <name>Atlassian Maven 2.x Repository</name> <url>http://repository.atlassian.com/maven2</url> </pluginRepository> </pluginRepositories> </profile> </profiles> to tell Maven where to look for the plugin, and .m2/settings.xml <profiles> <profile> <id>myprofile</id> <activation>...
  • Page 262: Troubleshooting License Problems

    Clover 3.1 Documentation Troubleshooting License problems This page lists the various ways in which you can specify your Clover for Maven 2 license. You can try one of the following processes if your Clover license is not being recognised correctly. You need a valid Clover license file to run Clover.
  • Page 263: Support Policies

    Clover 3.1 Documentation Using Clover with the maven-bundle-plugin This page contains instructions on how to use Clover with the maven-bundle-plugin. The following configuration is required to ensure that the and any instrumented source files are ignored by the clover.jar maven-bundle-plugin. Procedure Carry out the following steps.
  • Page 264: How To Report A Security Issue

    Clover 3.1 Documentation perform their normal functions) then it will be fixed in the next maintenance release provided that: The fix is technically feasible (i.e. it doesn't require a major architectural change). It does not impact the quality or integrity of a product. For non-critical bugs, the developer assigned to fixing bugs prioritises the non-critical bug according to these factors: How many of our supported configurations are affected by the problem.
  • Page 265: Security Advisory Publishing Policy

    Clover 3.1 Documentation How to Contribute to Feature Development Influencing Atlassian's release cycle We encourage our customers to vote on feature requests in JIRA. The current tally of votes is available online in our issue tracking systems, http://jira.atlassian.com http://studio.atlassian.com . Find out if your improvement request already exists .
  • Page 266: Update Policy

    Clover 3.1 Documentation An approximate mapping guideline is as follows: CVSS score range Severity in advisory 0 – 2.9 3 – 5.9 Medium 6.0 – 7.9 High 8.0 – 10.0 Critical Below is a summary of the factors which illustrate types of vulnerabilities usually resulting in a specific severity level. Please keep in mind that this rating does not take into account details of your installation.
  • Page 267: Compiling My Instrumented Sources Fails With A 'Code Too Large' Error

    Clover 3.1 Documentation Clover Troubleshooting Compiling my instrumented sources fails with a 'code too large' error. For some statements in my code Clover reports "No Coverage information gathered for this expression". What does that mean? — Clover will not measure coverage of a conditional expression if it contains an assignment operator. Hit count for multi-threaded test is incorrect in Clover's report.
  • Page 268: I'm Using The Maven-Clover-Plugin Version 2.4 With A License Downloaded From Atlassian And Get The Message 'Invalid Or Missing License

    Clover 3.1 Documentation I'm trying to get a coverage report mailed, but I keep getting "mail Failed to send email". How do I fix this? Q: I'm trying to get a coverage report mailed to the team as shown in your example, but I keep getting "[mail] Failed to send email". How do I fix this? The Ant task depends on external libraries that are not included in the Ant distribution.
  • Page 269: When Generating Some Report Types On My Unix Server With No Xserver, I Get An Exception "Can't Connect To X11

    Clover 3.1 Documentation Does my code compile and run as expected without Clover? You need to ensure that your project compiles and runs as expected before attempting to use Clover. Am I using the latest version of Clover? The latest version of Clover incorporates many bugfixes and improvements. If the answers in this section don't fix the problem you are encountering, please don't hesitate to contact us When generating some report types on my UNIX server with no XServer, I get an...
  • Page 270: Why Do I Get An Java.lang.outofmemoryerror When Compiling With Clover Turned On

    Clover 3.1 Documentation java.lang.OutOfMemoryError: PermGen space If you see this error when running Clover, you may need to increase the PermGen settings on your server JVM. This error may sometimes come about when implementing Clover on large projects, due to Clover's additional requirements. The required memory can be increased by setting the setting on the JVM.
  • Page 271: Clover Resources

    Clover 3.1 Documentation Clover Resources Resources for Evaluators Free Trial Feature Tour Resources for Administrators Clover Knowledge Base Clover FAQ Guide to Installing an Atlassian Integrated Suite The big list of Atlassian gadgets Downloadable Documentation Clover documentation in PDF, HTML or XML formats Plugins Clover Developer Documentation Atlassian Plugin Exchange...
  • Page 272: Contributing To The Clover Documentation

    Clover 3.1 Documentation Reference Documentation Clover Development Documentation Clover API Javadocs The Clover API allows developers to develop new hooks for Clover, to connect it into Continuous Integration servers such as AnthillPro TeamCity Cruise Control and similar products. The Clover API also provides classes to optimise tests programatically. This may be necessary if you are using a custom testing framework or your tests are defined in JUnit TestSuites.
  • Page 273: Clover 3.0 Early Access Program

    Clover 3.1 Documentation Here is a quick guide to how we manage community contributions to our documentation and the copyright that applies to the documentation: Monitoring by technical writers. The Atlassian technical writers monitor the updates to the documentation spaces, using RSS feeds and watching the spaces.
  • Page 274: Bookmarks

    Clover 3.1 Documentation Getting Started with the Clover-for-Grails Plugin We've provided some initial documentation on the Clover-for-Grails plugin below to help Grails developers get up and running with this plugin. Please refer to one of the following topics for more information: .bookmarks Clover 2.0 Bookmarks This page is a container for all the bookmarks in this space.

Table of Contents