Running JUnit Test in parallel on Suite Level?

前端 未结 2 1825
说谎
说谎 2020-12-31 08:14

I have a bunch of tests that are organized in JUnit test suites. These tests are greatly utilizing selenium to test a web application. So, naturaly for selenium, the runtime

2条回答
  •  粉色の甜心
    2020-12-31 08:47

    Since Suite is used to annotate a Class, so run the Suite-annotated class in JUnitCore.runClasses(ParallelComputer.classes(), cls) way. cls are Suite-annotated classes.

    @RunWith(Suite.class)
    @Suite.SuiteClasses({
    Test1.class,
    Test2.class})
    public class Suite1 {
    }
    
    @RunWith(Suite.class)
    @Suite.SuiteClasses({
    Test3.class,
    Test4.class})
    public class Suite2 {
    }
    ...
    JUnitCore.runClasses(ParallelComputer.classes(), new Class[]{Suite1.class, Suite2.class})
    

提交回复
热议问题