This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Code coverage in sonar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Code coverage in sonar" Watch "Code coverage in sonar" New topic
Author

Code coverage in sonar

Arka Sharma
Ranch Hand

Joined: Jun 15, 2011
Posts: 103
Hi,

I have created a simple maven project.Having only App.java under main>java>src and one AppTest.java under test>java>src.
In App.java I have written a class called Calculator having add and substract method.In AppTest.java I have written testAdd and testSubstract.AppTest working fine when I run it through eclipse.Now I copied App.java and AppTest.java 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

Regards,
Arka
 
wood burning stoves
 
subject: Code coverage in sonar
 
Similar Threads
sonar requires a project with an existing pom.xml, but the build is not using one
How to run UT in Eclipse/Maven
Cobertura code coverage issue
Free Automatic CodeReview tool
In order to run junit 4.8.2 in maven do we need to have the folder src/test/java?