Stop overriding default methods in TrackingTestNGTestListener
At some point, TestNG started implementing listener methods as interface default methods, so we no longer need to override those methods with empty implementations.
This commit is contained in:
parent
1b3aeba5ee
commit
7ba736dc06
|
@ -17,6 +17,7 @@
|
||||||
package org.springframework.test.context.testng;
|
package org.springframework.test.context.testng;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
|
@ -33,28 +34,25 @@ import org.testng.ITestResult;
|
||||||
*/
|
*/
|
||||||
public class TrackingTestNGTestListener implements ITestListener {
|
public class TrackingTestNGTestListener implements ITestListener {
|
||||||
|
|
||||||
public final List<Throwable> throwables = new ArrayList<>();
|
|
||||||
|
|
||||||
public final AtomicInteger testStartCount = new AtomicInteger();
|
public final AtomicInteger testStartCount = new AtomicInteger();
|
||||||
|
|
||||||
public final AtomicInteger testSuccessCount = new AtomicInteger();
|
public final AtomicInteger testSuccessCount = new AtomicInteger();
|
||||||
|
|
||||||
public final AtomicInteger testFailureCount = new AtomicInteger();
|
public final AtomicInteger testFailureCount = new AtomicInteger();
|
||||||
|
|
||||||
|
public final List<Throwable> throwables = Collections.synchronizedList(new ArrayList<>());
|
||||||
|
|
||||||
public final AtomicInteger failedConfigurationsCount = new AtomicInteger();
|
public final AtomicInteger failedConfigurationsCount = new AtomicInteger();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish(ITestContext testContext) {
|
public void onTestStart(ITestResult testResult) {
|
||||||
this.failedConfigurationsCount.addAndGet(testContext.getFailedConfigurations().size());
|
this.testStartCount.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart(ITestContext testContext) {
|
public void onTestSuccess(ITestResult testResult) {
|
||||||
}
|
this.testSuccessCount.incrementAndGet();
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTestFailedButWithinSuccessPercentage(ITestResult testResult) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,17 +66,8 @@ public class TrackingTestNGTestListener implements ITestListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTestSkipped(ITestResult testResult) {
|
public void onFinish(ITestContext testContext) {
|
||||||
}
|
this.failedConfigurationsCount.addAndGet(testContext.getFailedConfigurations().size());
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTestStart(ITestResult testResult) {
|
|
||||||
this.testStartCount.incrementAndGet();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTestSuccess(ITestResult testResult) {
|
|
||||||
this.testSuccessCount.incrementAndGet();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue