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:作爲測試參數的巨大集合遺失輸出