1
A
回答
1
好吧,我仍然不知道如何正式做到这一点,但我只是重定向标准输出和错误:
/**
* Redirect standard output and error to appropriate files
*/
public void redirectStandardOutputAndErrorToFiles(className) {
def outFile=new File(System.getProperty("java.io.tmpdir")+File.separator+className+".out.log")
if (outFile.exists()) {
outFile.delete()
}
def errFile=new File(System.getProperty("java.io.tmpdir")+File.separator+className+".err.log")
if (errFile.exists()) {
errFile.delete()
}
def out=new PrintStream(new FileOutputStream(outFile))
def err=new PrintStream(new FileOutputStream(errFile))
System.setOut(out)
System.setErr(err)
}
0
您可以将以下指令添加到测试任务它告诉输出标准流:
build.gradle:
test {
testLogging.showStandardStreams = true
}
相关问题
- 1. Gradle TestNG结果输出
- 2. 使TestNG Reporter输出出现在Gradle HTML测试报告中
- 3. 如何查看VS2010中测试结果窗口中单元测试的输出结果?
- 4. PLSQL查看sys_refcursor的输出结果
- 5. x单元测试死锁
- 6. 使用nUnit测试死锁
- 7. 忽略测试结果的stderr输出
- 8. TestNg记者信息在肯定的测试结果输出中重复
- 9. 关闭测试输出TestNG中
- 10. 比较结果,shell中测试的输入和输出
- 11. gradle这个看输出model.components.binaries.all
- 12. Selenium:导出测试结果
- 13. Rspec - 查看测试和html_safe
- 14. Python中的每个实例的输入,测试和输出结果
- 15. TFS 2015 Build/Release - 查看自动测试用例的历史测试结果
- 16. 调试PyThread_acquire_lock死锁
- 17. TestNG:如何验证通用函数中的测试结果
- 18. @AfterMethod中的TestNG如何知道测试结果?
- 19. Mysql死锁检测
- 20. EUnit查看测试结果的详细信息
- 21. 查看Behat在浏览器中的测试结果,如Jasmine
- 22. TestNG的测试组
- 23. ActiveRecord3死锁重试
- 24. PHP:死或检查结果?
- 25. TestNG的测试给出了空
- 26. 在Visual Studio中查看Google测试结果
- 27. 通过嵌套数组循环测试并输出结果相同的结果
- 28. TestNG的重试测试
- 29. ResNet50从keras给出了不同的预测结果和输出结果
- 30. TestNG:作为测试参数的巨大集合遗失输出