找到textui/TestRunner.java,看到了阔别很久的main方法,OK,开始运行测试。
TestRunner.java
/**
* 运行自身的start方法,并将返回结果提交给容器
*/
public static void main(String args[]) {
TestRunner aTestRunner= new TestRunner();
try {
TestResult r= aTestRunner.start(args);
if (!r.wasSuccessful())
System.exit(FAILURE_EXIT);
System.exit(SUCCESS_EXIT);
} catch(Exception e) {
System.err.println(e.getMessage());
System.exit(EXCEPTION_EXIT);
}
}
/**
* Starts a test run. Analyzes the command line arguments and runs the given
* test suite.解析传入参数,并根据参数运行对应的方法
*/
public TestResult start(String args[]) throws Exception {
String testCase= "";
String method= "";
boolean wait=