how to execute unit test cases in clover

Hi,

we have an web application. I have proceed wherein we have a application-clover.war, clover.jar and clover.db which is available after clover:instrument goal.

Please suggest how to deploy it in to a server and how do i execute the test cases in server.

We are using maven3.

Thanks in advance

1 answer

This widget could not be displayed.

Hi Khadeer,

I assume that your test server is located on a different machine than the build machine, am I right?

 

Steps in general are as follows:

1. You have to deploy your WAR containing instrumented classes. Use your standard procedure to do this.

2. You have to ensure that clover.db file(s) is(are) available on this server too. Just copy them to some location.

3. You have to ensure that these clover.db file(s) will be found by the application. There are several ways to achieve this:

    • you can instrument Clover with an absolute path in 'initstring' and copy clover.db files to the server to the same directory or
    • in case you have only one clover.db file: use -Dclover.initstring=/path/to/clover.db JVM parameter for your server to point to a correct location or
    • in case you have many clover.db files: use a relative path in 'initstring' during instrumentation and use -Dclover.initstring.basedir=/common/path/to/clover/db/files on the server to point to a folder where they are stored

4. After this, run your tests as usual.

5. After tests are finished, copy generated coverage files back to your build workspace and run clover:clover goal to generate reports. 

 

See also:

https://confluence.atlassian.com/display/CLOVER/Using+Clover+for+web+applications

https://confluence.atlassian.com/display/CLOVER/Working+with+Distributed+Applications

https://confluence.atlassian.com/display/CLOVER/Using+Clover+in+various+environment+configurations

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

534 views 3 19
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