继上边6.4 执行用例
上一篇讲到了runSuitesSequentially这个方法会去调用SuiteRunnerWorker.run方法,那么run方法的具体实现又是什么样的呢?
走读本段代码后发现run方法中又继续调用了runSuite方法,该方法主要作用:执行suite然后将结果存到suiteRunnerMap中。执行suite的方法则是调用suiteRunner.run()方法,继续细看suiteRunner.run()方法
SuiteRunnerWorker srw = new SuiteRunnerWorker(suiteRunnerMap.get(xmlSuite), suiteRunnerMap,
verbose, defaultSuiteName);
srw.run();
@Override
public void run() {
runSuite(m_suiteRunnerMap, m_suiteRunner.getXmlSuite());
}
/**
* Runs a suite
* @param suiteRunnerMap map of suiteRunners that are updated with test results
* @param xmlSuite XML suites to run
*/
private void runSuite(SuiteRunnerMap suiteRunnerMap /* OUT */, XmlSuite xmlSuite)
{
//日志级别大于0时,在控制台中输出要执行的tetsng.xml的路径,如下图一
if (m_verbose > 0) {
StringBuffer allFiles = new StringBuffer();
allFiles.append(" &