Code example for TestResult

Methods: errorCountfailureCountrunCountwasSuccessful

0
 
    /** 
     * Prints the header of the report 
     */ 
    public void printHeader(TestResult result) {
        if (result.wasSuccessful()) {
            writer().println();
            writer().print("OK");
            writer().println (" (" + result.runCount() + " tests)");
     
        } else { 
            writer().println();
            writer().println("FAILURES!!!");
            writer().println("~~ Test Results ~~~~~~~~~~~~");
            writer().println("      Run: "+result.runCount());
            writer().println(" Failures: "+result.failureCount());
            writer().println("   Errors: "+result.errorCount());
        } 
    } 
 
    public void printErrors(TestResult result) {
        if (result.errorCount() != 0) {
Contextual code suggestions in your IDE  Get Codota for Java