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.
In order to run all of the tests in a directory including tests in nested directories you will need to use something like googlecode. junittool box. Right clicking on this class and selecting Run As JUnit test runs all of the tests in the specified directory including all tests in nested subfolders. Save this answer.
Press Alt+Shift+X,T to run the test (or right-click, Run As > JUnit Test). If you want to rerun the same test method, just press Ctrl+F11. For this to work, ensure that you've told Eclipse to always run the last launched application.
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.
You can create a JUnit test suite like this :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With