I would like to count the failed tests, and make a failure only once when all tests completed. These tests are run by Jenkins every night, and reporting the results if there are failures or errors. The problem is that I can't even start counting, because this has only failureProperty and errorProperty which can be true or false, but when it reaches the first failed or errorous test, it stops and fails. I didn't find good solution with google, they recommended me these properties, but they don't do what I need.
here is the code:
<junit printsummary="true" fork="yes" forkmode="once"
showoutput="false" haltonfailure="no" maxmemory="1024m"
errorProperty="test.failed" failureProperty="test.failed">
<classpath refid="junit.classpath" />
<batchtest fork="yes" todir="${junit.dir}/raw" >
<formatter type="xml" />
<fileset dir="${classes.dir}">
<include name="**/*Test.class" />
<exclude name="*ear*/**"/>
<exclude name="**/Base*.class" />
<exclude name="**/JNDI*.class" />
</fileset>
</batchtest>
</junit>
<fail message="At least one test failed or has errors, please check test results in Jenkins to see details!" if="test.failed" />
Do I miss something important? It seems haltonfailure="no" parameter is not working in this case.
Thanks in advance if you can help me!