I am looking for a way to create and run JUnit TestSuite non-statically.
I am currently doing something like this:
public class MyTestSuite { public static TestSuite suite() { TestSuite suite = new TestSuite(); suite.addTest(...); suite.addTest(...);
I do this because I create TestCases, which I add to the package programmatically. With this solution, I ran into the problem that my MyTestSuite class is never created. I would like to associate it with a spring container, for example. using
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={...}) @Transactional
but I see no way to tell SpringJUnit4ClassRunner that it should also run my program tests.
Thank you for your help! Erik
source share