System.out.print() doesn't show anything in test methods

前端 未结 8 1306
春和景丽
春和景丽 2020-12-14 15:28

I\'m trying to print some data with System.out in my unit tests (@Test mehotds), but it is not showing anything. However, it works properly in

8条回答
  •  清歌不尽
    2020-12-14 15:39

    The -Dtest=* command line option of Maven appears to trigger the show of stdout in unit tests.

    By convention, the stdout shows in target/surefire-reports/*-output.txt. Apparently, the Surefire plugin developers could not reuse stdout for communication of many things between the tests and the framework.

提交回复
热议问题