Specifying an order to junit 4 tests at the Method level (not class level)

前端 未结 6 2175
醉酒成梦
醉酒成梦 2020-12-02 10:50

I know this is bad practice, but it needs to be done, or I\'ll need to switch to testng. Is there a way, similar to JUnit 3\'s testSuite, to specify the order o

6条回答
  •  没有蜡笔的小新
    2020-12-02 11:09

    If you want to run junit tests in order "just as they present in your source code", and don't want to modify your tests code, see my note about this here:

    How to run junit tests in order as they present in your source code

    But it is really not a good idea, tests must be independent.

提交回复
热议问题