Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

coverage not increasing although code gets hit

shubham chandel May 7, 2014

Hello All,

I have multiple projects into my eclipse workspace. I have enabled clover on all projects. when i execute my code with clover only the package having main method is shown in green. If I set a debug point in other projects and execute test case the debug pointer stops at breakpoint but the clover does not shows it as hit. It still shows it in red.

What may be the issue?

1 answer

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2014
  • Do you have pure Java projects or maybe Java+Groovy? I'm asking, because Groovy is not supported in Clover-for-Eclipse plugin (you can instrument Groovy code using Ant, Maven, Grails etc).

  • Could you peform full rebuild of all projects? Do you see a class in which you have set a breakpoint in the "Coverage Explorer" view? I'm asking because you may have some non-instrumented classes.

  • What initstring do you use for your databases (project settings > Clover)? It it a relative or absolute path? I'm asking because maybe two or more projects have the same path to a Clover database and are overwriting each other?

  • How do you run your tests? Are they standard JUnits? Or maybe an application is running in separate JVM (in Tomcat for instance)? I'm asking because clover.jar may be missing on class path.

  • Do you use "Run as ..." or "Run with Clover as ..." button to run your tests? The latter option adds the clover-runtime.jar to Xbootclasspath.
shubham chandel May 7, 2014
  • It is pure java project
  • I have performed full rebuild and i can see all required classes in coverage explorer
  • am using relative path to project directory for clover db
  • I am executing test from testNG. Even if i manully test my application the debug pointer stops at breakpoint but the code does not get green
  • I use Run With Clover

But still have issues

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 10, 2014

Do you see any Clover warnings in a console output when running your application or tests?

I'm asking because if your application runs in a working directory different from Eclipse's one, then Clover' coverage recorder may not find the clover.db file (as you're using relative paths). In such case using the -Dclover.initstring or -Dclover.initstring.basedir JVM parameter may help.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events