With @RunWith( Suite.class )
I can group test classes into a test suite and run them all together. With @RunWith( Parameterized.class )
I can run the same test for different parameters. What I want is to run a test suite for different parameters. Is there a way of doing that?
Asked
Active
Viewed 1,409 times
7

assylias
- 321,522
- 82
- 660
- 783

Frank HJ Cuypers
- 71
- 2
2 Answers
1
I always recommend that people switch to TestNG, which is just like JUnit 4, except with more functionality.
It has built-in support for parameterization and grouping.
I suspect what you're trying to do will be easy with TestNG - JUnit does not have the 'grouping' capability that TestNG does.
http://testng.org/doc/migrating.html
http://www.mkyong.com/unittest/testng-parameter-testing-example/

ianpojman
- 1,743
- 1
- 15
- 20
-
Obviously, I agree :-) TestNG's approach lets you have as many data providers and as many test methods that use them per class, and it also passes the data directly as parameters to your test method, as opposed to JUnit's awkward use of fields to pass this information around. – Cedric Beust Apr 30 '12 at 22:46
0
I stumbled upon the same problem. In the end I wrote a custom extension for JUnit and open sourced it. You can have a look at the library and its docs here: https://github.com/PeterWippermann/parameterized-suite

Peter Wippermann
- 4,125
- 5
- 35
- 48