0

I am working on a Spring MVC + maven based project which contain good number of scenarios to be tested, analysed and recorded in reports (like Code coverage, static code analysis etc.). The scenarios are more challenging so we cannot do the code coverage using only Unit Test cases if possible I need to do the on-the-fly instrumentation at runtime of the project!.

I have searched for the same but I didn't get a good example to achieve the requirement, as I red in some websites Jacoco is capable of doing on-the-fly code coverage but I am not able to implement it on my project.

What exactly I need: I have already integrated my project with Surefire + Jacoco + SonarQube for static code analysis + code coverage for unit test cases, but I am looking for coverage report on how the controller flows across application tiers while executing few scenarios when application is running on the server like Jboos wildfly. So that I can cover most of the challenging scenarios of the application.

please help me if I am wrong to understand the on-the-fly instrumentation if possible guide me to configure the same.

Any help will be appreciated.

Rajesh Hatwar
  • 1,843
  • 6
  • 39
  • 58
  • What did you try and did not work exactly ? did you read the documentation : https://docs.sonarqube.org/display/PLUG/Usage+of+JaCoCo+with+Java+Plugin ? – benzonico Feb 07 '17 at 12:45
  • @benzonico I have integrated sonar + jacoco into my maven project and I able to execute the code coverage for my unit test cases but other than unit test cases I want to cover more scenarios so when my application is running on server and when I execute some test scenarios I expect jacoco to show the controller flows across application – Rajesh Hatwar Feb 08 '17 at 06:09
  • So as a first step I have Attached the JaCoCo's agent to Maven's JVM via `export MAVEN_OPTS="$MAVEN_OPTS \ -javaagent:$HOME/tools/jacocoagent0.7.4.jar=output=tcpserver,port=6300"` then I tried to run the scenarios on the application through UI then I tried to get jacoco dump and report via `mvn jacoco:dump jacoco:report` but it was failed by throwing exception like failed to connect to localhost/127.0.0.1:6300 – Rajesh Hatwar Feb 08 '17 at 06:10
  • @benzonico I am not able to understand why I am getting Connection refused error – Rajesh Hatwar Feb 08 '17 at 06:15

0 Answers0