void (ExposedTestResult result) { if (!myParamsMap.containsKey(result)) { onTestStart(result); } Throwable ex = result.getThrowable(); String methodName = getTestMethodNameWithParams(result); final Map<String, String> attrs = new LinkedHashMap<>(); attrs.put("name", methodName); final String failureMessage = ex != null ? ex.getMessage() : null; if (ex != null) { String expectedPrefix = " expected ["; ComparisonFailureData notification; try { notification = ComparisonFailureData.create(ex); } catch (Throwable e) { notification = null; } if (notification == null) { try { notification = TestNGExpectedPatterns.createExceptionNotification(failureMessage); } catch (Throwable e) { notification = null; } } else { expectedPrefix = "expected:"; } ComparisonFailureData.registerSMAttributes(notification, getTrace(ex), failureMessage, attrs, ex, "Comparison Failure: ", expectedPrefix); } else { attrs.put("message", ""); } myPrintStream.println(MapSerializerUtil.asString(MapSerializerUtil.TEST_FAILED, attrs)); onTestFinished(result); }