I have many Spring Test classes (defined using @RunWith(SpringJUnit4ClassRunner)) that I want to group in test suites so that I load new configurations once for every suite instead of for every test class.
Right now I have a TestExecutionListener listener to every Spring test that will reload the configurations, but I want to save that since many tests share the same configurations.
Sadly, niether Spring supports listening to JUnit TestSuites nor JUnit supports the listener concept for TestSuites.
If you wish to perform actions before/after a junit test suite, you can use @BeforeClass and @AfterClass, or even @ClassRule. You can do your setup in there for the entire suite. Using the following example:
This produces as output: