Best way of logging exceptions when tests fail (e.g. using a junit rule)

前端 未结 3 1669
孤独总比滥情好
孤独总比滥情好 2021-01-13 07:54

When I\'m running a complete test suite, it would be helpful if exceptions that caused a test to fail would appear in my (SLF4J-)log. What is the best method to achieve this

3条回答
  •  心在旅途
    2021-01-13 08:25

    Look outside the box... What are you using to run the tests? Most environments for running tests (e.g., Ant, Jenkins, Maven, etc.) have means for using a testrunner that outputs an XML file, with support for aggregating the XML files from a suite into a comprehensive report.

提交回复
热议问题