Code example for TestResult

Methods: addListener

0
 
    /** 
     * Creates the TestResult to be used for the test run. 
     */ 
    protected TestResult createTestResult() {
        return new TestResult();
    } 
 
    public TestResult doRun(Test test) {
        return doRun(test, false);
    } 
 
    public TestResult doRun(Test suite, boolean wait) {
        TestResult result= createTestResult();
        result.addListener(fPrinter);
        long startTime= System.currentTimeMillis();
        suite.run(result);
        long endTime= System.currentTimeMillis();
        long runTime= endTime-startTime;
        fPrinter.print(result, runTime);
 
        pause(wait);