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

1 vote
Accepted answer

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!

 

1 vote

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 Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,039 views 15 13
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