coverage not increasing although code gets hit

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
  • 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.
  • 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

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
Community showcase
Published Wednesday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

66 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you