How to write multi-threaded unit tests?

后端 未结 3 1520
青春惊慌失措
青春惊慌失措 2021-01-31 11:39

I\'d like to know if there are some unit testing frameworks which are capable of writing multi-threaded tests easily?

I would imagine something like: invoke a special te

3条回答
  •  再見小時候
    2021-01-31 11:50

    Just using the concurrency libraries would simplify your code. You can turn your boiler plate code into one method.

    Something like

    public static void runAll(int times, Runnable... tests) {
    
    }
    

提交回复
热议问题