I've a small project where the main code is wrote in java but the tests are mostly groovy code. If i use JaCoCo for code coverage (called by Sonar), the code coverage is not done on my java code, as it seems JaCoCo does not use its special classloader when loading the java classes with groovy. Strangely, I remember it worked before (before sonar version 2.12 which embed JaCoCo).
Does anyone know how to fix it ?
My mistake: forgot to add the integration-test maven profile to the sonar configuration in jenkins.
Related
I am attempting to generate code coverage for a jar that is in my library. I have a suite of tests that uses this jar and I would like to see how much coverage I am getting with my test suite. In Intellij's run/configuration menu, even if I manually specify to include all the classes in the jar, ex. "com.my.jar.*", I get 0% code coverage. In Eclipse, I was able to easily select the jar, hit 'Coverage', and get accurate results. Has anyone else converting to Intellij from Eclipse experienced the same issue?
I got stuck on this too - I was able to get it working in Eclipse instead of Idea
According to the maven-failsafe-plugin's convention. integration tests need to be placed under src/it. This is all fine and dandy, but IntelliJ Idea doesn't:
Treat the code in src/it as test code
Let you run these tests through the UI
I have 2017.1.3 and I have also installed the Maven Test Support Plugin. Doesn't Idea support this kind of separation?
I want to force developers to run findbugs plugin for their business class before commit them . now want solution to run findbugs plugin from code but I cannot find any solution to access intellij idea plugin from code.
Can any body help me?
It's not possible to run the findbugs IntelliJ IDEA plugin from your main() method, because IntelliJ IDEA plugins can only run in an IntelliJ IDEA instance.
However, findbugs is also available as a standalone tool, which you can very easily run from the command line, as described in the documentation.
I'm using Cobertura 2.3.0 from http://cobertura.github.io/cobertura/ to analyze my project for test coverage, and I'm getting a
Error: Could not find or load main class net.sourceforge.cobertura.instrument.Main
When trying to execute cobertura-instrument.bat from the command line. I've looked at this batch file and it's trying to load several JARs from the %COBERTURA_HOME%/lib folder that don't exist. I've manually downloaded these JARs but am getting other strange errors.
java.lang.IncompatibleClassChangeError: class net.sourceforge.cobertura.instrument.pass1.DetectIgnoredCodeClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
Is it possible that this release was incorrectly updated? I don't see a way to make this work any other way. Further, does anybody know of a working test-coverage utility, preferably a working different version of Cobertura?
I've tried Nounit and several others, but have not gotten the type of clean output that I know Cobertura can produce.
Answering my own question in hopes it can help somebody.
At time of writing, there is a known bug with Cobertura throwing a ClassNotFoundException in certain circumstances. See the following issue tracker page: https://github.com/cobertura/cobertura/issues/74#issuecomment-41383903
For the time being, I've gone with EclEmma Eclipse plugin for EMMA for my test code coverage, and got nice, pretty results the way I wanted.
I've been searching on the internet on tutorials of code coverage test in NetBeans.
However, most tutorials use a plugin called NetBeans Code Coverage Plugin, which should be found in the 'Available Plugins'. However, it's not there.
So, how can I test Java code coverage in NetBeans 7.0?
You can find both Cobertura Module Test Coverage and Maven Test Coverage in Available Plugins. You should choose one according to your build tool.
Have a look at this link for more info:
http://wiki.netbeans.org/MavenCodeCoverage
Following link will navigate to you at NetBeans Code Coverage Plugins.
http://plugins.netbeans.org/plugin/38945/unit-tests-code-coverage-plugin-updated-for-netbeans-7-0