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

vinod kumar July 1, 2015

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 votes
Answer accepted
Grzegorz Lewandowski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 1, 2015

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

 

0 votes
Grzegorz Lewandowski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 3, 2015

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 

0 votes
vinod kumar July 2, 2015

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events