TestNG“失败的测试”输出可以使用换行符吗?

时间:2013-01-04 19:51:50

标签: java unit-testing testing tdd testng

当我运行TestNG测试时,我得到以下截断输出的失败测试:

Failed tests: retrievedDataFromService(com.mydomain.ServiceTest): The returned data is not correct:(..)

来自Assert.fail()的实际字符串是这样的:

StringBuilder msg = new StringBuilder("The returned data is not correct:");
msg.append("\n expected = ");
msg.append("<xml>some data</xml>");
msg.append("\n was = ");
msg.append("<xml>some other data</xml>");

如果我从邮件中删除换行符,则会显示所有内容:

Failed tests: retrievedDataFromService(com.mydomain.ServiceTest): The returned data is not correct: expected = <xml>some data</xml> was = <xml>some other data</xml>

在“失败的测试”输出中有没有办法让TestNG显示换行符?

0 个答案:

没有答案