簡體   English   中英

將單元測試結果/報告寫入文本文件和控制台的最佳做法或模式

[英]Best practices or patterns for writing unit test results/reports to text file as well as to console

我們有自己的用於Blackberry應用程序的單元測試框架。 現在,我們只需要在控制台上打印,就需要在文本文件中生成單元測試報告。

CommandController.java-將命令發送到Blackberry模擬器並以字符串格式接收響應。 它顯示哪些命令已發送到模擬器以及控制台上的響應

TestResults.java-將上面收到的字符串響應與期望值進行比較,並顯示成功或失敗信息。

從主類SimmTest.java調用CommandController.java和TestResults.java。

現在,我想從CommandController.java和TestResult.java中捕獲文本文件中的信息,並在控制台上顯示它們。

請讓我知道此方案的最佳做法或模式。 感謝幫助!

我不了解Java和Blackberry,但我想顯示測試結果的格式是“ TAP”

http://en.wikipedia.org/wiki/Test_Anything_Protocol

基本上,測試的輸出是這樣的:

  1..12
  ok 1 - This is the title of the first test
  not ok 2 - This is the title of the second test

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM