How to run test methods in specific order in JUnit4?

后端 未结 18 2173
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 04:35

I want to execute test methods which are annotated by @Test in specific order.

For example:

public class MyTest {
    @Test public void          


        
18条回答
  •  眼角桃花
    2020-11-22 05:09

    Here is an extension to JUnit that can produce the desired behavior: https://github.com/aafuks/aaf-junit

    I know that this is against the authors of JUnit philosophy, but when using JUnit in environments that are not strict unit testing (as practiced in Java) this can be very helpful.

提交回复
热议问题