Package not covering

Hello Marek,

I am facing an issue with clover. I am using com.cenqua.clover.updatesite_3.1.11.v20130325000000 with Eclipse-Juno. For my code coverage I need to instrument few packages of a jar and deploy it into an application which runs in Tomcat7.0_21. Now my problem is I am not seeing any coverage of a package only which deals with logging. As soon as I start Tomcat, I see all the other packages covered except that particular package. If I start Tomcat in eclipse environment, I see coverage of all the packeges.I have clover-runtime jar in tomcat lib directory. Do I need to set anything else in Tomcat? Please let me know what am i missing? I really need your help badly in this. Or if there are any instrumentation problems with that particular packages, where can i know that.

Thanks in advance....

-Prashanth

2 answers

0 vote

Hello Prashanth,

Few things are worth checking:

1) Is the logging JAR instrumented by Clover?

Check if you have classes named like SomeClassName$__CLR_some_hash_code.class in the JAR archive.

2) Is the Clover database (clover.db) accessible from application running on Tomcat?

If you have used relative path to clover.db (Project Settings > Clover > Initstring), then use -Dclover.initstring=/path/to/clover.db for Tomcat. If you have used an absolute path and the Tomcat is running on the same machine, then check write permissions to the directory containing clover.db (permission problem happens usually on Unix, on Windows it's rather unlikely).

3) Do you use more than one Clover database?

Do you have several projects in the Eclipse workspace?

If yes, then do they have separate paths to clover.db defined?

If yes, then do you use absolute paths for each of them?

If not, then do you use -Dclover.initstring.basedir parameter for Tomcat?

4) Are Clover's coverage recorders starting properly at runtime?

In order to check this, run Tomcat with the -Dclover.logging.level=debug

Next search the log for messages like:

CLOVER: Unable to load the coverage database at <clover.db>
CLOVER: No coverage data will be gathered.

This means that the clover.db was not found - usually due to a relative path in initstring.

CLOVER: Clover database: <clover.db> is no longer valid. Min required size for currently loading class: NNN, actual size: MMM
CLOVER: Coverage data for some classes will not be gathered.

This usually means that some sources were recompiled and the Clover database was recreated from scratch, but you have deployed old classes. Rebuild the whole workspace.

Re-entrant Clover initialisation detected. Some coverage may not have been recorded before this point.

or

Clover runtime not yet initialised.

This means that Clover was in middle of its initialisation when a new instance of a Clover's coverage recorder was requested. The request should be honored and coverage recording should start once Clover finishes initialisation.

CLOVER: Clover database: <clover.db> can only be used for reporting because it is the result of a merge.
CLOVER: Coverage data for some classes will not be gathered.

This means that databases were merged using <clover-merge> and cannot be used for coverage recording. Rather unlikely as you're working in Eclipse...

Cheers
Marek

Hello Marek,

Thanks for your reply. The problem was something different.

The package which was not recording is available in couple of other jars, which are in the same directory. So, the package is executed from the other jar whose name starts with "ö", where as the instrumented jar name starts with "r". The instrumented code never touched until and unless the jar starting with "r" is replaced with alphabet before "o".

Thanks,

Prashanth

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted yesterday in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

40 views 0 5
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