Can I avoid running junit tests twice in eclipse when using a TestSuite?

前端 未结 5 1247
隐瞒了意图╮
隐瞒了意图╮ 2020-12-16 13:55

I need to do some per-suite initialisation (starting a web-server). It is working fine except that when I run all tests in my project in eclipse my tests run twice. My test

5条回答
  •  一生所求
    2020-12-16 14:35

    There is a solution, it's a bit tricky, but it may easily resolve your problem: create one suite class, and include all your suite classes in it. Then you can use this suite class to run all your tests.

    @RunWith(Suite.class)
    @Suite.SuiteClasses({
        AXXSuite.class,
        BXXSuite.class,
        CXXSuite.class
    })
    public class AllSuites {    
    
    }
    

提交回复
热议问题