From 3c1f39d0567e77eb8193c5bb1919c9d79eebe38e Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Thu, 5 Jul 2018 14:46:37 +0200 Subject: [PATCH] testng: extract data from junit exceptions if applicable (IDEA-195047) --- .../src/org/testng/IDEATestNGRemoteListener.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java b/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java index 849607f86d77..d5c157664be3 100644 --- a/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java +++ b/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java @@ -225,11 +225,20 @@ public class IDEATestNGRemoteListener { if (ex != null) { ComparisonFailureData notification; try { - notification = TestNGExpectedPatterns.createExceptionNotification(failureMessage); + notification = ComparisonFailureData.create(ex); } catch (Throwable e) { notification = null; } + + if (notification == null) { + try { + notification = TestNGExpectedPatterns.createExceptionNotification(failureMessage); + } + catch (Throwable e) { + notification = null; + } + } ComparisonFailureData.registerSMAttributes(notification, getTrace(ex), failureMessage, attrs, ex); } else {