EclEmma 3.1.8 Java Code Coverage for Eclipse Drag to your running Eclipse workspace to install EclEmma Java Code Coverage
Eclipse Community Award 2008
JaCoCo
Inspected with sonarqube
jobs at mtrail
The Java Specialists' Newsletter

Session Import and Export

While EclEmma is primarily designed for test runs and analysis within the Eclipse workbench, it provides import and export functionality.

Session Import

If your program is launched outside the Eclipse debugging environment, you might import JaCoCo execution data from these launches. This allows to study the coverage results directly in your source code. The Coverage Session import wizard can be activated form the File → Import... menu or from the Coverage view's context menu.

The wizard dialog requires you to specify the source of the execution data on its first page. There are three possible sources:

  • Local *.exec file location.
  • Remote *.exec file URL.
  • IP address and port of a JaCoCo agent attached to a running process. You can also specify whether the execution data should be reset in the target VM when dumping the data.

If you keep a reference to the original execution data source (check the corresponding import option) you can simply re-import the data as often as you want. For this use the Refresh option from the context menu of the Coverage view or simply hit the F5 key.

On the second page you can specify session name and the scope, which are the source folders and libraries that should be considered.

Warning: Imported execution data must be based on the exact same class files that are also used within the Eclipse IDE. If the external launch was based on different class files (e.g. created with different compiler) no coverage will be shown.

Session Export

The session export wizard allows to export coverage sessions in one of these formats:

  • HTML: A detailed and browseable report as a set of HTML files.
  • Zipped HTML: Same as above but zipped into a single file.
  • XML: Coverage data as a single, structured XML file.
  • CSV: Coverage data on class level granularity as comma-separated values.
  • Execution data file: Native JaCoCo execution data format.

The Coverage Session export wizard can be activated form the File → Export... menu or from the Coverage view's context menu. There must be at least one coverage session available to use the export wizard.

Select one of the existing sessions and the export format.