Has JUnit4 begun supporting ordering of test? Is it intentional?

前端 未结 6 2176
攒了一身酷
攒了一身酷 2020-11-30 12:51

A newbie to JUnit (in fact JUnit 4) and came across suite way of executing test

@RunWith(Suite.class)
@Suite.SuiteClasses(
        {                                  


        
6条回答
  •  情书的邮戳
    2020-11-30 13:32

    No, ordering is not supported. And yes, it is intention:

    KentBeck commented (December 30, 2010): Independent tests are more valuable, so JUnit by design does not support test ordering.

    If you need this feature, you could use TestNG with it's @Test(sequential = true).

提交回复
热议问题