Eclipse – How to configure Eclipse to run your tests automatically

continuous integrationeclipsejunit

I read this article: Configure your IDE to run your tests automatically
http://eclipse.dzone.com/videos/configure-your-ide-run-your

It's pretty easy to configure Eclipse IDE to run an Ant target every time a file is saved.
MyProject -> Right-click : Properties -> Builders -> New -> Ant Builder

The problem is that the builder has to rebuild the jar on every save, which is very long. The JUnit tests run using the .classes in the jar.

We already have JUnit configurations (EclipseIde .launch files which contains the whole classpath to run the tests). I wish I could create a builder that wraps those JUnit launch files. This would have the benefit of running the tests against Eclipse .classes (faster than rebuilding the jar). Also the test results are displayed in the JUnit view.

Has anybody manage to do that?

Best Answer

I recently started using Infinitest and it seems to somehow "know" which parts of the code affect which test cases. So when you change some code, it automatically re-runs the tests which are likely to break. If the test fails, it marks an error at the spot where it failed, the same way Eclipse would mark a coding error like calling a non-existent method or whatever. And it all happens in the background without you having to do anything.