How to analyse junit test results - unit-testing

I have a set of test cases, for which I need to demonstrate an analysis. Is there a plugin or any other way to analyse test results?

You can use Cobertura Maven Plugin for analysing and code coverage reports on the unit tests.
You can refer the below links for more details on Cobertura Maven Plugin:
http://www.mojohaus.org/cobertura-maven-plugin/
https://www.mkyong.com/qa/maven-cobertura-code-coverage-example/
For Netbeans, you can refer tikione-jacocoverage plugin from below link:
http://plugins.netbeans.org/plugin/48570/tikione-jacocoverage

Related

How to separate each JUnit result report in Jenkins?

My project is composed of several DLLs that I must test with different unit tests. I generate an XML file for each of the tests then I transform them into a JUnit format to be read by Jenkins. It works very well.
On the other hand, the test results are all in the same topic on the Jenkins interface and I would like to separate them for each DLL. It is for a more practical aspect for the visualization of the tests. I haven't found the solution yet. That's why I'm asking you if there is a solution for this problem.
I tried several plugins like JUnit or Warning NG. But the result remains the same. The JUnit plugin puts all the results in the same section and makes no distinction and the Warning NG plugin fails to parse the XML report to display it in Jenkins.

How do I ignore JAVA tests in Coverity Connect analysis result?

I use Coverity to scan my project for security issues.
What I would like to know is how to exclude any java test (NOTE: both integration and unit) from the analysis results that are available after a defect commit.
I did use maven to build the project and I excluded Unit tests using the flag -Dmaven.skip.test=true.
Though that made Coverity not scanning unit tests, it still makes it scan integration ones.
All the integration tests in my project contain the word "Test" in the file titles. Therefore I started looking at the filter section made available in Coverity. What I tried then was a regex (.*(!?(Test).*)$) but it did not work. It seems that coverity supports two matching character (* and ? - see image below) while it does not seem to support any negative look-around.
Is there any good way to accomplish this task in an easy and clean fashion?
Since Coverity relies on your Maven build, you can exclude:
compilation and execution of both unit tests (by Surefire plugin) and integration tests (by Failsafe plugin) by adding -Dmaven.skip.test=true
execution of both unit and integration tests via -DskipTests
execution of integration tests via -DskipITs
Instead, if you have your integration tests in a separate Maven module, you can directly exclude that from the Maven build via profile, like in below example -- see extract of aggregator's pom.xml and maven command line to be launched:
<modules>
<!-- remove 'my-it-module' from this list -->
</modules>
<profiles>
<profile><id>build-it</id>
<activation><activeByDefault>true</activeByDefault></activation>
<modules><module>my-it-module</module></modules>
</profile>
</profiles>
and then mvn install -P !build-it

Generating code coverage using jasmine-sbt plugin

I am using sbt-jasmine-plugin for unit testing my java script files. However, i am not sure how to generate the coverage report using this plugin. Anybody using the same plugin, generating the code coverage for the js files??

Dotcover report (nunit) not covering all classes in assembly.

Dotcover report (nunit) is not covering all the classes in the assembly. When I see the report generated by Dotcover using nunit-console.exe (2.4.1), I find only couple of classes from the assembly but not all.
I don’t use NUnit with dotCover, but there are the common things.
Did you check your dotCover config file? Probably, there are some filters there.
More info here: http://www.jetbrains.com/dotcover/webhelp/dotCover__Introducing_Console_Runner.html

Exclude maven module from emma code coverage

I have a maven super pom, consisting of multiple modules. I run mvn emma:emma on the super pom, and I get emma code coverage for all the modules (that have tests defined.)
Now I wish to exclude one of the modules from the emma code coverage run. Such that when I run mvn emma:emma on the super pom, the specific module does not get code coverage measured. But when I do mvn test all module tests will be executed as normally.
How do I do that?
As I see in Maven Emma plugin docs, there's not such property to exclude some projects (modules) from coverage measurement. It seems that all reactor projects will be handled by Emma plugin.
What can be useful in your case is the plugin's ability to exclude some test classes (maven.emma.filter.excludes property) from coverage report, but it would work only of you're able to specify masks that catch test classes of modules' you want to effectively exclude, so it might not work in your case.