Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code coverage in sonar

Arka Sharma
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have created a simple maven project.Having only under main>java>src and one under test>java>src.
In I have written a class called Calculator having add and substract method.In I have written testAdd and testSubstract.AppTest working fine when I run it through eclipse.Now I copied and into the respective folder of my maven artifact.Now I run "mvn test" it shows "Build Successful"."Total test run 2".Now I have built the project in hudson.In the hudson build console same output is shown.Now I open up sonar and clicked on the sonar job to see the code coverage it shows

Code coverage Test success
- 0 tests
I am not getting why it is showing 0 test success when both in maven and hudson it is showing total test run 2.And one more thing how to see the code coverage.Please help

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic