Choose order to execute JUnit tests

后端 未结 8 1040
执笔经年
执笔经年 2020-12-11 03:32

I wanted to choose the order to execute the JUnit tests. I have 4 classes with several test methods in it, my goal is to execute, for instance, method Y of class A, then met

相关标签:
8条回答
  • 2020-12-11 04:01

    This might be interesting to you: JExample

    A different approach to testing with interdepentent tests.

    0 讨论(0)
  • 2020-12-11 04:02

    Create a TestSuite and call the test methods in the desired order. @Yishai is right in that JUnit is designed so each test is independent. So if you are calling test methods that can be run independently then there should be no problem with creating a TestSuite to cover a scenario for a specific calling-order.

    0 讨论(0)
提交回复
热议问题