1、TestCase.run 調用TestResult.run
2、TestResult.run 調用TestResult .StartTest
3、TestResult.run 創建一個Anonymous 類,實現接口Portectable
4、在Portectable. protect 方法中調用TestCase .runBare
5、通過運行Portectable.runBare 調用runBare,通過Exception 捕獲增加錯誤
及失敗報告
runBare:不使用TestResult 直接運行
runTest:運行測試,注意每調用runTest 只運行當前fName 指定的方法
etName:返回fName
setName:設置fName
protected
createResult:創建一個TestResult
setUp:在運行runTest 前調用
tearDown:在運行runTest 后調用
Class TestFailure
用于存放測試對比失敗信息的類。主要為Class TestResult 調用。主要屬性
protected Test fFailedTest;
protected Throwable fThrownException;
fFailedTest 存放失敗的TestCase 信息,fThrownException 存放失敗提示信息。
主要方法:
public
TestFailure:初始化,對fFailedTest、fThrownException 賦值。
failedTest:返回fFailedTest
thrownException:返回fThrownException
文章來源于領測軟件測試網 http://www.kjueaiud.com/