Issue with clover on jboss

Hello, I have a server and it is running my app. I want to get the metrics from Clover on remote(distrebuted) testing my application I am testing my application with a browser, after each test, get the files Clover(i e: clover.db5nb4l4_h99zod5p) further generated report using the mvn clover2: clover, resulting in a blank report, ie covering code 0%, what am I doing wrong?

3 answers

0 votes

I'm not sure whether you have a distributed test or not:

  • do you have two (or more) JVMs running your application? do you have <distributedCoverage> feature configured in your build? do you have unit tests running on a different JVM than application under test? if all answers are yes, then it's a Clover's Distributed Coverage feature
  • if your web application is running on single JVM and you perform testing using the web browser then probably it's not a Distributed Coverage feature

What do you exactly mean by "testing application with a browser":

  • manual tests or
  • junits simulating user actions, i.e. there's a chain like: junit (JVM on test machine) -> browser (non-java process) -> application (JVM on JBoss)?

Could you give more details how Clover is configured in your pom.xml?

Thanks for your answer, Accepted my application get requests and answers responses.

I just send requests from the browser. And get response from my app.

My application consists of two modules: webapp and servlet parts, the servlet part loaded into webapp as jar library. In both parts in the pom.xml is written the same clover configuration (is this correct?)

feature of my application is: webapp part is not Java classes used for this module so is therefore not created clover.db (Am I right?)

my clover configuration(for webapp part and server part):



0 votes

Have you seen this manual: Using Clover for web applications? Please note that Distributed Coverage must be enabled only if both conditions are met:

  • tests are being executed in a different JVM than application code called by them (for example JUnits executed during build calls servlets deployed on Tomcat, or EJBs on JBoss) and
  • you're interested in the per-test coverage feature (i.e. which test methods have covered which business methods) or you're interested in the test optimization feature

According to your description, you don't have unit tests but you test the application manually. So first condition is not met.

I propose following modifications in your pom.xml:

  • remove the whole <distributedCoverage> section
  • add flushPolicy (interval or threaded, default is threaded) and flushInterval (default 500ms) - optional

One more thing: how do you copy clover.db to your JBoss installation? I don't see <cloverDatabase> attribute defined in pom.xml. Do you have -Dclover.initstring=/path/to/clover.db declared as JBoss' JVM argument?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Jira Service Desk

What's new in Jira Service Desk Server: Introducing 4.0 & more - Feb 2019

Hello Atlassian Community!  I'm Teresa, the Product Marketing Manager   for Jira Service Desk Server at Atlassian. I'm excited to announce two exciting releases for Jira Service De...

69 views 0 0
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