views:

822

answers:

5

I'm using IntelliJ-Idea to write Java daemons. We use JUnit to unit test our code and want to have automated runs on check-in to subversion.

Are there any tools available that can automatically run unit tests and then send reports in email and to Hobbit?

+1  A: 

We use CruiseControl to automatically build projects and run unit tests whenever a change is committed to subversion. It can be configured to send e-mail notifications if the build/unit tests fail.

g .
+2  A: 

We use Hudson as our Continuous Integration server. You can set-up jobs to poll your SCM at specific intervals and run Ant tasks on them. We have ours set-up to run a build and testing target when new changes in SVN are detected and to then email those who are involved with the project if the build or testing targets fail.

Hates_
Your link is wrong. Hudsons looks like it fits. I'm going to evaluate CruiseControl and Hudson. Thank you
Gunnar Steinn
@gunnarsteinn - Thanks for pointing out the broken link :)
Hates_
+1  A: 

Not sure about Hobbit, but TeamCity is another nice Continuous Integration server. It can be configured to run on Subversion commit and has a decent IntelliJ plugin. It'll send emails too.

Dan Vinton
+2  A: 

I think you should look into continuous integration, as others have suggested. I've personally tried CruiseControl and Hudson, and prefer Hudson. You can just download it and run it to see if you like it, configuration is a breeze, just:

  1. Download hudson.war from http://hudson.dev.java.net.
  2. Run it in standalone mode (java -jar hudson.war).
  3. Point your browser to http://localhost:8080 to configure and use.

It has built-in support for Maven and Ant if you use those, but if not, you can simply write your own batch file/shell script.

If continuous integration is not an option, you can look into the use of a Subversion post-commit hook (http://svnbook.red-bean.com/en/1.0/svn-book.html#svn-ch-5-sect-2.1). I have no experience with using hooks for the purpose you described, so I really can't offer a lot of help here.

Jack Leow
+2  A: 

We use TeamCity for all our java projects. Mostly we use junit with maven and TeamCity already have a maven2 runner so setting up a new build task is easy.

You tell TeamCity where your svn trunk is and select a runner.

If you already use IntelliJ there is a plugin for TeamCity so you can get instant feedback if your tests pass when doing a commit. And if you are realy lazy you can select remote run when doing a commit and select "Only commit if tests pass".

And as a final note. TeamCity is not limited to just run java test, we use it to run python unit tests as well.