TikiOne JaCoCoverage - plugin detail

NetBeans module that provides JaCoCo code coverage (Java5,6,7,8 compatible). For Ant based JavaSE projects. Maven projects are already supported by NetBeans, please check http://wiki.netbeans.org/MavenCodeCoverage for code coverage with JaCoCo.

NetBeans Plugin - TikiOne JaCoCoverage
Plugin owner: ent38
Website: https://github.com/jonathanlermitage/tikione-jacocoverage
Added: 2013-04-22
License: WTFPL
Category: Testing
Downloaded: 3,199 times
Rating:
 4.59, by 4 users

Plugin Log Show log

Versions available

Download plugin   Download size: 1.35 MB   Last Update: 2014-11-22

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

v1.4.0: Java EE support
Changelog: https://github.com/jonathanlermitage/tikione-jacocoverage/blob/master/CHANGELOG.md

Verifications for NetBeans versions

8.0 verification PASSED See verification details
Download plugin   Download size: 1.09 MB   Last Update: 2013-12-14

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

v1.3.3: maintenance release
Changelog: https://github.com/jonathanlermitage/tikione-jacocoverage/blob/master/CHANGELOG.md

Verifications for NetBeans versions

7.4 verification PASSED See verification details
Download plugin   Download size: 1.08 MB   Last Update: 2013-09-08

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

v1.3.1: maintenance release
Changelog: https://github.com/jonathanlermitage/tikione-jacocoverage/blob/NB731-JDK6/CHANGELOG.md

Verifications for NetBeans versions

7.3 verification PASSED See verification details


Introduction

The JaCoCoverage Plugin is a Netbeans plugin that enhances the existing NetBeans functionality with new code coverage features.

The plugin works as a transparent additional service that colors all java files according to the unit tests coverage information. With code coverage enabled user continues to work with his/her project in the usual way but can easily view the test coverage of the project classes.
The code coverage plugin will update the code coverage data and refresh editors markup every time a unit test (or any selected Ant target) is executed for the project. Currently the Java Application, Java Library and Java Project with Existing Sources are supported. Maven projects are already supported by NetBeans, please check http://wiki.netbeans.org/MavenCodeCoverage.

Coverage collections are based on JaCoCo in order to support Java 5,6,7,8 bytecode. Take it as a modern alternative to the EMMA and Cobertura based plugins.

JaCoCo is a free code coverage library for Java, which has been created by the EclEmma team (http://www.eclemma.org/jacoco/).

[ You have to be logged in to be able to comment. ]

User Comments

  

Further development ideas

I use NB almost daily and found your Jacocoverage plugin some time ago. It's a great plugin! I have used Jacocoverage lately a lot and I like it very much, it is very useful plugin, but adding these proposed features would increase its value even more.

1) Add support for running single test file with Jacocoverage
Now it is possible to do "Run With Jacocoverage" and "Test with Jacocoverage" and "Reset coverage data" when you hit 2. mouse button on top of your project.
Currently it is not possible to run single test file with Jacocoverage.
Can you add "Test file with Jacocoverage" command to popupmenu opening when hitting 2. mouse button on top of a single java test file?
In large project it is a great benefit if you can run a single test file instead of all files for updating your coverage data. Running all files might take too long time.

2) Reset coverage data only when user hits "Reset coverage data".
Now it seems that every time I hit "Run With Jacocoverage" the existing coverage data is deleted/reset.
It would be more usefull if user could do several "manual" test runs (i.e. "Run with Jacocoverage) and also run JUnit tests and all these tests (manual and JUnit tests)
were included into coverage data until user hits again "Reset coverage data".

3) Add support for depending projects / libraries.
Suppose that I have developed three libraries (lib A, lib B and lib C) and an application D. Lib A is called from lib B and application uses libs B and C.
Suppose also that I have JUnit tests for libs A, B, C and application D. Now I want to measure test coverage for application D and all the code it uses.
Currently it seems that only thing I can do is to run jacocoverages for lib A, lib B, lib C and application D.
These reports miss following coverages:
- lib A test coverage that is exectued when lib B calls lib A during lib B JUnit tests
- lib B test coverage that is exectued when application D calls lib B during application D JUnit tests
- lib C test coverage that is exectued when application D calls lib C during application D JUnit tests
- lib A test coverage that is exectued when application D calls lib B which calls lib A during application D JUnit tests
In my opinion, application D test coverage report should also include test coverages of all libraries it uses.

I hope that you can further develop these ideas into Jacocoverage very soon. I guess that atleast features 1) and 2) should be easy to implement, 3) might take more time.
Do you find these proposal useful / implementable and if yes when could we have them?


I have one problem with Jacocoverage. One of my java test files cause Java heap space java.lang.OutOfMemoryError every time I run it with "Test with Jacocoverage". Without Jacocoverage tests run OK. I have tried to modify project.properties by adding test.run.args=-Xms128m -Xmx2500m there but it does not help. Do you know what to do in this case?

I use NB8 and project builds are based on Ant.

Thank you for your help.
Posted by ---J--- on May 23, 2014
  

Re: NB Module support

NB platform support is under development, but I can't provide any schedule. I progress (very) slowly, due to a lack of free time. I may release a version this year, or later, I don't know.
Thx for your understanding.
PS: any contribution is welcome ;)


You can try to develop your NB platform project with Maven instead of Ant. NetBeans 8.0 already provides code coverage for Maven projects. Check http://wiki.netbeans.org/MavenCodeCoverage for details (you can choose Cobertura or JaCoCo, look at the end of this webpage). It works fine with Java SE and Java Web/EE Maven projects. I guess it will work with any kind of Maven project, including NB Platform projects.
Posted by ent38 on May 06, 2014
  

NB Module support

Is there any plan for supporting NB platform ?

In previous messages i have asked about NB platform support, and you said that it is in progress.

Is there any plan to support it,

I constantly asking about it, because actually we are desperate about finding a plug-in that can measure coverage of NB platform projects.

Thanks...
Posted by aligokalppeker on May 06, 2014
  

Re:

I am able to right click on the project and see "Run with JaCoCoverage" and "Test with JaCoCoverage". Neither seem to have any affect for me either. The .jacocoverage directory exists in the root of my project, but is empty.
Posted by mraza83 on May 06, 2014
  

Re

Do a right-clic on the project.
Posted by ent38 on May 06, 2014
  

Re: Plugin does nothing

> Please use the JaCoCoverage action menu

OK, I've been through all the pull-down menus at the top of NetBeans (File, Edit, View ... etc).

I have also tried pulling down context menus by right-clicking in the projects window, on
1. The project
2. "Source Packages"
3. My source package
4. My source class
5. "Test packages"
6. My test package
7. My test class

None of these menus contains a JaCoCoverage action menu.

I have repeated all of the above steps in three projects: one Ant, one Maven and one Gradle.
In all three cases the result is the same - there is no visible way to invoke JaCoCoverage.

Where _exactly_ is the JaCoCoverage action menu?
Posted by pbholmes on May 06, 2014
  

Re: Re: Plugin does nothing

Hi,
The Alt+F6 shortcut doesn't launch Jacoco.
Please use the JaCoCoverage action menu to launch tests with coverage ;)
Posted by ent38 on May 05, 2014
  

Re: Plugin does nothing

I launch my tests by pressing Alt-F6, and it works in that my tests are run and I get a green bar.
I looked at the link you (ent38) provided, and the Options->Java->JaCoCoverage tab appears, just as shown there.
There is no coverage highlighting on my source code, no textual coverage report, and I can't see any new actions in the menus.
Posted by pbholmes on May 05, 2014
  

Re

Unfortunately, NB platform projects are not supported yet.
Posted by ent38 on May 04, 2014
  

Is there any news for NB Module and Maven support

Hi,

Thanks for your answer, actually my primary interest is support of Netbeans Module System( aka Netbeans Platform )

Maven is the another part of it.

Thanks again,
Posted by aligokalppeker on May 04, 2014
  

Re: Plugin does nothing

Hi,
How to you launch tests? The plugin adds new actions to run test (or simply run the program) with code coverage.
See https://github.com/jonathanlermitage/tikione-jacocoverage/blob/master/DOCUMENTATION.md
Posted by ent38 on Apr 25, 2014
  

Plugin does nothing

I have an ant-based JavaSE application created in NetBeans 8.0. I also have JUnit tests covering most of my code.

I installed the TikiOne JaCoCoverage plugin, version 1.3.4.20140322.1836 from the NetBeans plugin portal. I got no error messages, and according to the NetBeans Plugins->Installed tab, the plugin was installed.

Unfortunately the plugin had no discernible effect on NetBeans. The editor colouring was unchanged, and the JaCoCoverage menu items illustrated above were nowhere to be seen.

-------------------------------------------
Part II

I then uninstalled the plugin portal version of the plugin, and installed instead the four nbms from the 8.0 zip on this page.

Same as above - the plugin simply does nothing at all.

Clearly I've missed some vital step, but from reading the documentation, I've no idea what.

Any tips?
Posted by pbholmes on Apr 25, 2014
  

Re

Hi,
Maven support is under development.

EDIT: please check http://wiki.netbeans.org/MavenCodeCoverage
Maven projects are now supported by NetBeans & JaCoCo ! ;)
Posted by ent38 on Apr 23, 2014
  

Is there any news for NB Module and Maven support

Hi there,

Is there any opportunity to commit support for NB Module and Maven support ?

Thanks...
Posted by aligokalppeker on Apr 23, 2014
  

Thanks for your efforts

I appreciate your help on netbeans users, and contributions on netbeans code coverage issues.

This plug-in is very helpful on coverage and with better NB module&Maven support it will be great.

Thanks...
Posted by aligokalppeker on Feb 23, 2014
  

Please be patient ;)

Hi,
I'll try to commit big changes asap.
Unfortunately, I can't provide any ETA: I work on this project on my free time only, and I am currently very busy.
Thx for your understanding.
Posted by ent38 on Feb 22, 2014
  

Any new release for NB7 Platform+Maven+JDK7 support

We are waiting a long time for this support. It is promised in 1.4 release. Is there any progress or ETA on this release?
Posted by aligokalppeker on Feb 22, 2014
  

Re: Maven support?

Hi,
Yes, Maven support will be added asap (I am also using it everyday).
I am currently working on Java EE support and NetBeans Modules support. I'll probably start the development of Maven support when the Java EE part is okay.
Posted by ent38 on Oct 11, 2013
  

Maven support?

Hi Jonnathan:
Excellent job; the "good ol' Code Coverage" was devouring one of my cores whenever I tried to check the coverage. The thing is, here at work we all use Maven projects. Is there a plan to add support for it? There are lots of Maven users that will benefit of it. I can help you to test it if you need, or even provide a patch or two on the weekends.
Posted by alied on Oct 09, 2013
  

just what the doctor ordered

This plugin was the missing peace if the puzzle.
Now we can move to java7 completely, because we want our
students to test and measure testcoverage in their prime language.
Good job.
Posted by homberghp on Jun 04, 2013
  

Re: Small problem

Hi,
this is a temporary problem.
Version 1.2.0 may be validated soon. It contains 4 NBM modules. Previous version is 1.1.1 and contains 3 NBM modules.
There is a bug in the PluginPortal infrastructure: it tries to publish the 3 updated modules from 1.1.1, but the 4th module from 1.2.0 is missing.
This issue will be automatically fixed with 1.2.0 validation.

Also, you have two solutions to install JaCoCoverage:
- download the plugin manually
- register the TikiOne JaCoCoverage update center into NetBeans (https://github.com/jonathanlermitage/tikione-jacocoverage/blob/master/README.md#download-stable-and-dev-builds): http://jacocoverage.tikione.fr/nbuc/updates.xml


// reminder: https://netbeans.org/bugzilla/show_bug.cgi?id=230621
Posted by ent38 on Jun 02, 2013
  

Small problem

I have a problem to install plugin inside Netbeans ("Available plugins" tab) - some libs are missed so it don't work "out of the box", but from this page it is installed successful.
Posted by yura.minsk on Jun 02, 2013
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo