/** * May be overridden (e.g. to add control codes for colouring terminal output) */ protected String getEndState(StepToken step) { return step.getEndState().toString(); }
private String colourizeEndState(StepEndState endState) { String result; switch(endState) { case PASSED: result = consoleColours.highlightGreen(endState.toString()); break; case FAILED: result = consoleColours.highlightRed(endState.toString()); break; case PENDING: result = consoleColours.highlightYellow(endState.toString()); break; case SKIPPED: result = consoleColours.highlightYellow(endState.toString()); break; case UNDEFINED: result = consoleColours.highlightRed(endState.toString()); break; case DRYRUN: result = consoleColours.highlightGreen(endState.toString()); break; case TIMEOUT: result = consoleColours.highlightRed(endState.toString()); break; default : result = endState.toString(); } return result; } }
/** * @return End state as a String containing terminal control codes to colourize output, unless disableColours sys prop is set true */ protected String getEndState(StepToken step) { StepEndState endState = step.getEndState(); return disableColours ? endState.toString() : colourizeEndState(endState); }