Unit Tests Coverage issue in sonar after upgrade to 4.2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unit Tests Coverage issue in sonar after upgrade to 4.2

inkaur
This post has NOT been accepted by the mailing list yet.
We have recently upgraded sonar from 2.14 to sonar 4.2. This has an effect on the Unit Test coverage values. The Unit Test showed 100% with 0 errors but after the upgrade  it now coming as 93.6% and 243 errors. If I see the details of the error, it shows the error message "A NullPointerException was thrown. This may indicate an error in your ActionForm, or it may indicate that the Struts ActionServlet was unable to find struts config file. TestCase is running from C:\Java\Jenkins\jobs\abc-quality\workspace\abc-WEB directory. Context directory is C:\Java\Jenkins\jobs\abc-quality\workspace\abc-WEB\WebContent. struts config file must be found under the context directory, the directory the test case is running from, or in the classpath.
servletunit.struts.ExceptionDuringTestError: A NullPointerException was thrown.  This may indicate an error in your ActionForm, or it may indicate that the Struts ActionServlet was unable to find struts config file.  TestCase is running from C:\Java\Jenkins\jobs\abc-quality\workspace\abc-WEB directory.  Context directory is C:\Java\Jenkins\jobs\abc-quality\workspace\abc-WEB\WebContent.  struts config file must be found under the context directory, the directory the test case is running from, or in the classpath."

We have not changed any configuration post upgrade so don't understand the reason of this error. This has further affected the code coverage percentage on sonar dashboard. How to resolve this error and get the unit test percentage as 100%.
We are using cobertura and not jacoco so would need help with cobertura end.
sonar properties being used are as below:

-Dsonar.login=sonar
-Dsonar.password=sonar
-Dsonar.dynamicAnalysis=reuseReports
-Dsonar.java.coveragePlugin=cobertura
-Dsonar.cobertura.reportPath=target/site/cobertura/coverage.xml
Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests Coverage issue in sonar after upgrade to 4.2

inkaur
This post has NOT been accepted by the mailing list yet.
Please reply.