Getting Started with Cover CLI for Windows
TeamsEnterprise
- 1. Download Cover CLI
- 2a. Install Cover CLI using
.zip
archive - 2b. Install Cover CLI using
.exe
installer - 3a. Activate license online using license key only
- 3b. Activate license offline using license key and offline license file
- 4. Writing and running your first tests
- 5. Next steps
See here for the full prerequisites for Cover CLI.
1. Download Cover CLI
Download the Diffblue Cover CLI .zip
archive or .exe
installer. The download link can be obtained from:
- Your Diffblue Cover welcome email received following trial signup or following license purchase
- Your organization’s internal file/app store
- Or contact Diffblue Support for help finding your download link
2a. Install Cover CLI using .zip
archive
Extract the Diffblue Cover CLI .zip
archive to the desired installation location
2b. Install Cover CLI using .exe
installer
Cover CLI can be installed manually using a setup wizard, or from the command line intended for unattended automated installations.
Setup wizard
1. Double-click the executable installer file.
2. Confirm any User Account Control
prompt asking permission for the installer to make changes on your device.
3. Click I accept the terms of this license agreement
and Next
.
4. Select the directory where you would like to install Cover and click Next
.
5. Confirm the creation of a new directory or overwriting an existing installation, if applicable.
6. After the installation progress is marked as completed, click Next
.
7. Click Generate an automatic installation script
if you would like to save your settings for future installations.
7. Click Done
.
Unattended installation
1. Create an installation configuration containing the path to your desired installation location as illustrated below:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<AutomatedInstallation langpack="eng">
<com.izforge.izpack.panels.licence.LicencePanel id="panel.licence"/>
<com.izforge.izpack.panels.target.TargetPanel id="TargetPanel_1">
<installpath>C:\Program Files\Diffblue</installpath>
</com.izforge.izpack.panels.target.TargetPanel>
<com.izforge.izpack.panels.install.InstallPanel id="InstallPanel_2"/>
<com.izforge.izpack.panels.finish.FinishPanel id="FinishPanel_3"/>
</AutomatedInstallation>
This file can also be generated by clicking Generate an automatic installation script
after manually installing Cover.
2. Install Cover using the following command:
dcover-installer-<version>.exe path/to/your/file.xml
3a. Activate license online using license key only
TeamsEnterprise (Online)
Using the license key provided in your welcome email or provided by your organization, activate your license using the command dcover activate XXXX-XXXX-XXXX-XXXX
.
For help troubleshooting network connection and proxy server settings check out our online licensing guide.
Diffblue Cover requires a remote license check with the Diffblue licensing server each time it is used. Offline license activation is available with the Enterprise Edition offline option only.
Entering multiple different license keys will overwrite the existing key.
You can check your license status by running the command dcover license
3b. Activate license offline using license key and offline license file
Enterprise (Offline)
If your organization has provided you with a license key and an offline license activation file, please follow the Enterprise Edition Offline Licensing instructions to activate.
4. Writing and running your first tests
We’re going to write some tests for Spring Petclinic, the legendary Spring demonstration application! Firstly, get Spring PetClinic by cloning the repository using git:
git clone https://github.com/diffblue/demo-spring-petclinic.git
Cover works by analyzing compiled Java code, so you must compile the project first:
cd demo-spring-petclinic
mvnw package
To create your first tests for the owner
package:
dcover create org.springframework.samples.petclinic.owner
Now you can run the tests written by Diffblue Cover CLI :
mvnw test -Dtest=*DiffblueTest.java
Take a look at the tests for the Owner Controller by opening src/test/java/org/springframework/samples/petclinic/owner/OwnerControllerDiffblueTest.java
in your IDE of choice.
5. Next steps
Please check out our documentation for more guides, videos and information, in particular our User Manual.