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

This widget could not be displayed.

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

 

This widget could not be displayed.

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?

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

176 views 2 0
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