Skip to content

Commit 92e8315

Browse files
committed
Update testng to 6.14.3
This version has bug when `SkipException` in TestListener leads to test being marked as `FAILED`. To workaround this issue TestListener has to set status specifically.
1 parent de61573 commit 92e8315

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

driver-core/src/test/java/com/datastax/driver/core/TestListener.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ public class TestListener extends TestListenerAdapter implements IInvokedMethodL
4545

4646
@Override
4747
public void onTestFailure(ITestResult tr) {
48+
if (tr.getThrowable() instanceof SkipException) {
49+
// Workaround for testng 6.13.x bug https://github.com/testng-team/testng/issues/1632
50+
// When SkipException thrown from beforeInvocation marks test as FAILED
51+
tr.setStatus(ITestResult.SKIP);
52+
return;
53+
}
4854
long elapsedTime = TimeUnit.NANOSECONDS.toSeconds((System.nanoTime() - start_time));
4955
long testTime = tr.getEndMillis() - tr.getStartMillis();
5056
tr.getThrowable().printStackTrace();

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<!-- more recent versions of pax-exam require JDK7+ -->
8080
<pax-exam.version>3.6.0</pax-exam.version>
8181
<url.version>2.4.0</url.version>
82-
<testng.version>6.8.8</testng.version>
82+
<testng.version>6.14.3</testng.version>
8383
<assertj.version>1.7.1</assertj.version>
8484
<mockito.version>1.10.19</mockito.version>
8585
<wiremock.version>2.27.2</wiremock.version>

0 commit comments

Comments
 (0)