void (Throwable failure, String messageName, String methodName) { final Map<String, String> attrs = new HashMap<>(); attrs.put("name", methodName); final long duration = System.currentTimeMillis() - myCurrentTestStart; if (duration > 0) { attrs.put("duration", Long.toString(duration)); } try { final String trace = getTrace(failure); ComparisonFailureData notification = null; if (failure.getClass().getName().equals("com.intellij.rt.execution.junit.FileComparisonFailure")) { notification = ComparisonFailureData.create(failure); } else if (failure instanceof ComparisonFailure || failure.getClass().getName().equals("org.junit.ComparisonFailure")) { notification = new ComparisonFailureData(ComparisonDetailsExtractor.getExpected(failure), ComparisonDetailsExtractor.getActual(failure)); } ComparisonFailureData.registerSMAttributes(notification, trace, failure.getMessage(), attrs, failure); } catch (Throwable e) { final StringWriter stringWriter = new StringWriter(); final PrintWriter writer = new PrintWriter(stringWriter); e.printStackTrace(writer); ComparisonFailureData.registerSMAttributes(null, stringWriter.toString(), e.getMessage(), attrs, e); } finally { System.out.println("\n" + MapSerializerUtil.asString(messageName, attrs)); } }