views:

119

answers:

3

I want to create a launcher/run configuration which runs only the JUnit tests in a selected set of test classes or selected set of packages. Now it looks like I'll have to create separate run configurations for each of my packages containing the tests I want to run. I also have a recollection of this working in older versions of Eclipse.

And yes, I know: The tests should be organized so that I wouldn't have this problem but reorganizing source folders right now is not an option.

I'm using Eclipse 3.4.2.

+1  A: 

You could add a test suite for the selected tests.

I would put them in a separate source folder, as otherwise tests will be run multiple times, once for the original test and once for each suite it is in.

starblue
Hod do I run a JUnit test suite in Eclipse?Yes, organizing the source folders in a sane way should be done, but it would be a massive amount of work for this project (the build files are a royal mess) and we can't afford that right now.
auramo
+1  A: 
Valentin Rocher
Thanks, should have been quite obvious :) I just created a test suite by hand not remembering that it shouldn't be done by extending the TestSuite-class. And of course couldn't run it :-) This solution will do, although it's not optimal: I'll have to remember to add all Test-classes which I create to the suite which is a bit redundant.
auramo
A: 

Hod do I run a JUnit test suite in Eclipse? Yes, organizing the source folders in a sane way should be done, but it would be a massive amount of work for this project (the build files are a royal mess) and we can't afford that right now.

auramo

You choose your TestSuite and press Alt+Shift+X, T or do Run -> Run As -> JUnit Test.

furtelwart