tags:

views:

25

answers:

2

How can I tell my modern Eclipse (Galileo, Helios) that all unit tests in my workspace (or anywhere) are written in JUnit 3 and so I would like them to be run with this older JUnit version?

I am talking about project/workspace/system default. Not a single specific test suite. I need it to use JUnit 3 by default for all these tiny 10-case suites I encounter.

+1  A: 

Go to Run icon on the toolbar, pick "Run Configurations", create a new JUnit configuration (or pick an existing one), then select JUnit 3.

If you have already tried to run a group of tests, this group should appear as an existing entry under the JUnit menu.

It's worth pointing out that most JUnit3 tests can be run by the JUnit 4 test runner. However, the JUnit4 runner can't handle some of the more esoteric features like certain test suite configurations.

skaffman
Thank you. But it appears to be a single configuration, not project/workspace/system default. I need it to use JUnit 3 by default for all these tiny 10-case suites I encounter.
Konrad Garus
A: 

You can run Junit 3 tests with the Junit 4 runner - see this SO question. I find this is the better solution as I'd recommend any new tests you write be with Junit 4 as the annoation-based testing is much nicer in my opinion.

hbunny
It's an old project and for the sake of sanity they all need to be JUnit 3. I can't run all my tests with JUnit 4 plugin - it doesn't handle failed assertions properly (shows some as errors, others are uncaught compatibility-related exceptions in console).
Konrad Garus