I was surprised when I could find the junit-tests.xsl file in CC.net which suppose to display the detail test result for JUnit. Spent half day to configure this out. Now I am very good at xsl file.
Something I didn’t know:
- JUnit is way behind NUnit. Test result doesn’t have ignored info. I then take over the ignore attribute for compile failure one.
- JUnit test result is also ugly, no <test-result> section caused a lot of problem to me.
- JUnit 4.4 is very different than 3.*, but, unfortunately, CC.net doesn’t support 4.*. (many major version 49 problems) I had to downgrade my test class to 3.* syntax. Yes, 4.4 is neater. See details here.
- JUnit’s test return code doen’t back to CC.net automaticlly. I had to configure the build file like this to make test failure showing ‘RED’ in CC.net
<junit errorProperty=”test.failed” failureProperty=”test.failed”>
<fail message=”Tests failed: check test reports.” if=”test.failed” />
Thanks to this post.