i have war and need to clover the build to my integration tests with maven

Hi,

I'm new to clover and have war from dev team and need to perform build with clover and run my integration tests with maven.

  1. Could you help how to build the war with clover.
  2. How to run mvn integration tests on clover build

3 answers

1 accepted

0 vote

Hi vinod kumar,

You can't really run Clover with already builded war file. It's because Clover is basing on source code instrumentation. But you can integrate Clover with Maven to build proper artifact and generate code coverage reports from it.

Here are some links from documentation how to achieve it:

Remember about setting up flush policy, which may cause some problems:

https://confluence.atlassian.com/display/CLOVER/Using+Clover+for+web+applications#UsingCloverforwebapplications-Flushingcoveragedatainapplicationcontainer

If you have problems with configuring Clover feel free to ask,

Best Regards,

Grzegorz Lewandowski

 

Thanks Grze,I'm able to move further on Clover.Hava a quick Question

  1. What is difference between mvn clean clover2:setup  and mvn clover2:instrument and when to use it
  2. Do i need to copy the colver jars tomcat server in lib folder or clover war is enough to place in webapps
  3. when i perform clover setup on my productservice dev code.In target folder, following folders are created
    1)classes
    2) Clover
    3) productservice.war
    4) productservice folders
    5) And in clover folder i see productservice-clover.war and productservice-clover
    Should i take productservice.war  or productservice-clover.war to place in tomcat/webapps?

0 vote

Hi, 

  1. The main difference is that clover2:setup saves time stamp for Clover test optimization feature and clover2:instrument forks the process and add suffixes for generated artifacts, in general if you won't be use any specific automatic deployment we're suggesting using clover2:setup 
  2. clover.jar is required by instrumented code otherwise you'll face ClassNotFoundErrors so your need ensure clover.jar is in the classpath by i.e:

    1. bundling it in created war in META-INF/lib directory
    2. providing it in $CATALINA_BASE/lib directory, for reference
  3. productservice-clover.war was generated because you've used clover2:instrument and in that case productservice.war won't contain instrumented sources, so in general it depends on which goal are you using:
    1. for clover2:setup you should use productservice.war
    2. for clover2:instrument you should use productservice-cloverr.war

Cheers,

Grzegorz 

Suggest an answer

Log in or Join to answer
Community showcase
Emilee Spencer
Published yesterday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

44 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot