StackTraceColorizer implements MessageColorizer { @Override public boolean colorizingNeeded(String message) { return exceptionLine.matcher(message).find(); } StackTraceColorizer(Theme theme); @Override boolean colorizingNeeded(String message); @Override Collection<MessageFragmentStyle> colorize(String message); @Override String getName(); @Override String getDescription(); @Override String getPluginableId(); @Override int getApiVersion(); static final String STYLE_ATTRIBUTE_EXCEPTION_MSG; static final String STYLE_ATTRIBUTE_LOCATION_INFO; }
@Test public void testColorizingNeeded() throws IOException { String string = IOUtils.toString(getSystemResourceAsStream("stacktrace/stacktrace.txt"), UTF_8); StackTraceColorizer colorizer = new StackTraceColorizer(new ThemeConfig(new BaseConfiguration())); boolean colorizingNeeded = colorizer.colorizingNeeded(string); AssertJUnit.assertTrue(colorizingNeeded); }