Code example for TestResult

Methods: errorCount, failureCount, runCount, wasSuccessful

0
    protected void printDefectTrace(TestFailure booBoo) {
        getWriter().print(BaseTestRunner.getFilteredTrace(booBoo.trace()));
    } 
 
    protected void printFooter(TestResult result) {
        if (result.wasSuccessful()) {
            getWriter().println();
            getWriter().print("OK");
            getWriter().println (" (" + result.runCount() + " test" + (result.runCount() == 1 ? "": "s") + ")");
 
        } else { 
            getWriter().println();
            getWriter().println("FAILURES!!!");
            getWriter().println("Tests run: "+result.runCount()+ 
                         ",  Failures: "+result.failureCount()+
                         ",  Errors: "+result.errorCount());
        } 
        getWriter().println();
    }