How can I make my JUnit tests run in random order?

后端 未结 5 2157
我在风中等你
我在风中等你 2020-12-06 04:16

I have the classical structure for tests, I have a test suite of different suites like DatabaseTests, UnitTests etc. Sometimes those suites contains other suites like SlowDa

5条回答
  •  囚心锁ツ
    2020-12-06 04:48

    In general what you need to do is to write your own test runner and in the test runner class aggregate the methods and randomly run each test (make sure you don't run a test twice).

    Read more about the test framework and how to write your own test runner here: http://www.ddj.com/architect/184415674

提交回复
热议问题