From 4e2e4edba0efbd7ea89e9d72db1e0559f412c601 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Wed, 13 May 2015 20:20:59 +0200 Subject: [PATCH] testng: mark test as success but print corresponding throwable if test fail within accepted percentage (IDEA-140261) --- .../src/org/testng/IDEATestNGRemoteListener.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java b/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java index c28cc2654aef..dbf62b274a17 100644 --- a/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java +++ b/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java @@ -79,7 +79,13 @@ public class IDEATestNGRemoteListener implements ISuiteListener, IResultListener myPrintStream.println("\n##teamcity[testIgnored name=\'" + escapeName(getTestMethodNameWithParams(result)) + "\']"); } - public synchronized void onTestFailedButWithinSuccessPercentage(ITestResult result) {} + public synchronized void onTestFailedButWithinSuccessPercentage(ITestResult result) { + final Throwable throwable = result.getThrowable(); + if (throwable != null) { + throwable.printStackTrace(); + } + onTestSuccess(result); + } public synchronized void onStart(ITestContext context) {}