0

Hi I am trying to get code coverage for my web application.

I Instrumented my compiled classes then I deployed it in jetty server.

then i ran my test cases from http client and i was expecting cobertura.ser file to be generated at server but it is not generated when I stop jetty server.

please let me know how can i get code coverage for web application from jetty. I'm using java 1.7

I am not using maven.

I followed the steps based on below link.

Java: measure code coverage for remote scripting tests .

Community
  • 1
  • 1
Rama Krishna
  • 120
  • 8

1 Answers1

0

This is probably due to the fact that Cobertura dumps coverage data when the VM exits, not when the server stops.

You can have a look at the alternative maven plugin I wrote for Cobertura and its companion example project:

https://github.com/QualInsight/qualinsight-mojo-cobertura

https://github.com/pawlakm/qualinsight-mojo-cobertura-example

The documentation provided by the first link describes how to configure Jetty and with a small extension that dumps coverage data during server stop (see "Gathering IT test coverage data when running instrumented code on Jetty") This documentation is for Jetty 9.3, however the second link provides running examples for Jetty 7.6, 8.1, 9.2 and 9.3.

In your context, you should use wartest-jetty9.2.x module as it aimed at Jetty 9.2.x and JDK1.7. Have a look at the module's (and its parent) pom.xml file, as well as jetty.xml file

Do not hesitate to give feedback and ask questions, I'll do my best to help you.

Regards,

Kraal
  • 2,779
  • 1
  • 19
  • 36