JUnit in CC.Net

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:

  1. JUnit is way behind NUnit. Test result doesn’t have ignored info. I then take over the ignore attribute for compile failure one.
  2. JUnit test result is also ugly, no <test-result> section caused a lot of problem to me.
  3. 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.
  4. 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.

Advertisements

One thought on “JUnit in CC.Net

  1. Hi Frank,

    Are there any news on this topic? For example: support for JUnit 4?
    How about coverage reports for junit tests? Do you have some info on that?

    Thanks,
    Aaron

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s