Is there a JUnit TestRunner for running groups of tests?

前端 未结 9 754
既然无缘
既然无缘 2021-02-05 13:42

I am currently using JUnit 4 and have a need to divide my tests into groups that can be run selectively in any combination. I know TestNG has a feature to annotate tests to assi

相关标签:
9条回答
  • 2021-02-05 14:23

    JUnit 3 allows you to create test-suites which can be run like any other test. Doesn't JUnit 4 have a similar concept?

    0 讨论(0)
  • 2021-02-05 14:25

    JUnit has no such runner at the moment. Addressing the underlying issue, the need to get reasonable assurance from a test suite in a limited amount of time, is our highest development priority for the next release. In the meantime, implementing a Filter that works through annotations seems like it wouldn't be a big project, although I'm biased.

    0 讨论(0)
  • 2021-02-05 14:28

    If you're using ANT or maven, you can control which tests are run by filtering the tests by name. A bit awkward, but it might work for you.

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