How do I programmatically run all the JUnit tests in my Java application?

后端 未结 6 2010
逝去的感伤
逝去的感伤 2021-02-02 18:13

From Eclipse I can easily run all the JUnit tests in my application.

I would like to be able to run the tests on target systems from the application jar, without Eclipse

6条回答
  •  半阙折子戏
    2021-02-02 19:09

    I have not tried this as of yet, but came across this blog recently: http://burtbeckwith.com/blog/?p=52

    The author provides a class that discovers all your junits and runs them, so if you slot this in to your project it may provide the capability required?

    Hope this helps.

提交回复
热议问题