question about Example 3 in the "Using Clover in various environment" page

Hi,

 

A clover question:

I'm trying to collect code coverage result from our system test framework. I found the example 3( or 3b) matches my scenarios on this page: https://confluence.atlassian.com/display/CLOVER/Using+Clover+in+various+environment+configurations#UsingCloverinvariousenvironmentconfigurations-Example#3-multipleapplicationsexecutedonseveralserversinisolation

 

I'm confused about this line "As every application runs in their own JVM and due to fact that we have used cloverDatabase (and optionally singleCloverDatabase) pointing to absolute path on a network drive, we don't need to provide clover.initstring parameter at runtime, because correct path is hardcoded in instrumented classes."

Where does the "correct path" of clover.db stored? Hardcoded in the instrumented classes?

If that's the case, does that mean 2 clover instrumented apps can run on the same JVM and we can collect the code coverage data without a problem? Assuming I put the clover.db files into the same path as it was in the build machine?

 

Thanks in advance,

Will

 

 

 

2 answers

1 accepted

This widget could not be displayed.

Hi Will,

Where does the "correct path" of clover.db stored? Hardcoded in the instrumented classes?

Yes, Clover stores a path to a database file in every class instrumented (more precisely - in every top-level class, for anonymous classes or inner classes it uses a path from the enclosing class).

 

If that's the case, does that mean 2 clover instrumented apps can run on the same JVM and we can collect the code coverage data without a problem?

Yes, in a single JVM you can run multiple applications or application modules with different paths to clover.db. 

 

Assuming I put the clover.db files into the same path as it was in the build machine?

Yes, in case you used an absolute path in initstring, then you have to store clover.db files in the same location.

You can either copy them from a build machine to a test machine (e.g. tar -cf clover.db.tar `find . -name clover.db`; scp clover.db.tar ...) or use a network drive.

 

Alternatively, you can use a relative path and use -Dclover.initstring or -Dclover.initstring.basedir property on a test machine.

 

Regards
Marek 

Thanks for the help!

 

This widget could not be displayed.

PS: Please have a look also at Example #4 from the page you linked - I guess you may be interested in having per-test code coverage in reports. Also have a look at this tutorial: Working+with+Distributed+Applications - it shows a standard setup.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

462 views 6 6
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