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

This widget could not be displayed.
  • 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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

176 views 2 0
Join discussion

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