AnsiMessagePrinter implements MessagePrinter { public void print(final String messageId, Object...args) { out.print(this.format(bind(messageId, args))); } AnsiMessagePrinter(final PrintStream out); String format(final String message); String escape(final String str); void print(final String messageId, Object...args); void println(); void println(final String messageId, Object... args); @Override void flush(); static final String COLOR_RESET; static final String COLOR_BLACK; static final String COLOR_RED; static final String COLOR_GREEN; static final String COLOR_YELLOW; static final String COLOR_BLUE; static final String COLOR_MAGENTA; static final String COLOR_CYAN; static final String COLOR_WHITE; static final String COLOR_BRIGHT_BLACK; static final String COLOR_BRIGHT_RED; static final String COLOR_BRIGHT_GREEN; static final String COLOR_BRIGHT_YELLOW; static final String COLOR_BRIGHT_BLUE; static final String COLOR_BRIGHT_MAGENTA; static final String COLOR_BRIGHT_CYAN; static final String COLOR_BRIGHT_WHITE; static final String BG_BLACK; static final String BG_RED; static final String BG_GREEN; static final String BG_YELLOW; static final String BG_BLUE; static final String BG_MAGENTA; static final String BG_CYAN; static final String BG_WHITE; static final String BG_BRIGHT_BLACK; static final String BG_BRIGHT_RED; static final String BG_BRIGHT_GREEN; static final String BG_BRIGHT_YELLOW; static final String BG_BRIGHT_BLUE; static final String BG_BRIGHT_MAGENTA; static final String BG_BRIGHT_CYAN; static final String BG_BRIGHT_WHITE; }
@Test public void testPrint() { final String resetCode = randomUUID().toString(); final String blue = randomUUID().toString(); final HashMap<String, String> colors = new HashMap<>(); colors.put("blue", blue); colors.put("red", blue); final AnsiMessagePrinter printer = new AnsiMessagePrinter(mock(PrintStream.class)); printer.setResetCode(resetCode); printer.setColors(colors); printer.print(" <red>x</red> {0} - <red>{1}</red>", "src/test/lua/test-asset.lua", "assertion failed!"); }