Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 227799 - Provide better code coverage integration
Provide better code coverage integration
Status: NEW
Product: java
Classification: Unclassified
Component: Project
7.3
PC All
: P3 with 4 votes (vote)
: TBD
Assigned To: Tomas Zezula
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-22 07:28 UTC by tomzi
Modified: 2014-02-18 21:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomzi 2013-03-22 07:28:17 UTC
There is no working plugin that does code coverage for tests in maven. Please provide this functionality :) (Using emma....)
Comment 1 tomzi 2013-03-22 09:46:43 UTC
Ignore the comment above I found code coverage support through this page: http://wiki.netbeans.org/MavenCodeCoverage

I created a new profile in my pom, adding:

<build>
    <plugins>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.5.7.201204190339</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Then I set my profile via 'Set Configuration' and then 'magically' the new option 'Code Coverage' option appears.

I don't know - is it just me, but this is mightily unuserfriendly. And by the way the coverage plugin does not work for me, for some reaseon, but this is another bug I will raise.

This one is just about user experience
I had to go through a lot of loopholes to get the coverage thingy:
1.) Netbeans did not show me *any* sign of that it was able to do code coverage.
2.) Thus I had to search on the internet, had to install a plugin that didn't work for maven (http://wiki.netbeans.org/TutorialCodeCoveragePlugin) then tried to install another plugin (http://wiki.netbeans.org/MavenCodeCoverage), but NB said it is already installed.
3.) I needed to change my current root pom, to add the above profile. But now I can not check in the pom file, since I am not allowed to. 

Please DO improve the user experience here!
Maybe similar to the current formatting via checkstyle support?
.) Add a new Code Coverage section to 'Project Properties', that would suggest to use a current configuration (profile) or create a new section or help to enable somehow the codecoverage functionality

.) Maybe even add functionality to not be POM invasive to show code coverage, such that I can see coverage without changing my POM's
Comment 2 alied 2014-02-18 21:32:08 UTC
This applies to Windows as well


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo