Skip to content

Commit 435a4c0

Browse files
add support for testng 7.1 (via #422)
1 parent 6565635 commit 435a4c0

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

allure-testng/src/main/java/io/qameta/allure/testng/AllureTestNg.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.testng.IClass;
4040
import org.testng.IConfigurationListener;
4141
import org.testng.IInvokedMethod;
42-
import org.testng.IInvokedMethodListener2;
42+
import org.testng.IInvokedMethodListener;
4343
import org.testng.ISuite;
4444
import org.testng.ISuiteListener;
4545
import org.testng.ITestClass;
@@ -102,7 +102,7 @@
102102
public class AllureTestNg implements
103103
ISuiteListener,
104104
ITestListener,
105-
IInvokedMethodListener2,
105+
IInvokedMethodListener,
106106
IConfigurationListener {
107107

108108
private static final Logger LOGGER = LoggerFactory.getLogger(AllureTestNg.class);
@@ -367,13 +367,8 @@ public void onTestFailedButWithinSuccessPercentage(final ITestResult result) {
367367

368368
@Override
369369
public void beforeInvocation(final IInvokedMethod method, final ITestResult testResult) {
370-
//do nothing
371-
}
372-
373-
@Override
374-
public void beforeInvocation(final IInvokedMethod method, final ITestResult testResult,
375-
final ITestContext context) {
376370
final ITestNGMethod testMethod = method.getTestMethod();
371+
final ITestContext context = testResult.getTestContext();
377372
if (isSupportedConfigurationFixture(testMethod)) {
378373
ifSuiteFixtureStarted(context.getSuite(), testMethod);
379374
ifTestFixtureStarted(context, testMethod);
@@ -382,6 +377,7 @@ public void beforeInvocation(final IInvokedMethod method, final ITestResult test
382377
}
383378
}
384379

380+
385381
private void ifSuiteFixtureStarted(final ISuite suite, final ITestNGMethod testMethod) {
386382
if (testMethod.isBeforeSuiteConfiguration()) {
387383
startBefore(getUniqueUuid(suite), testMethod);
@@ -468,12 +464,6 @@ private FixtureResult getFixtureResult(final ITestNGMethod method) {
468464

469465
@Override
470466
public void afterInvocation(final IInvokedMethod method, final ITestResult testResult) {
471-
//do nothing
472-
}
473-
474-
@Override
475-
public void afterInvocation(final IInvokedMethod method, final ITestResult testResult,
476-
final ITestContext context) {
477467
final ITestNGMethod testMethod = method.getTestMethod();
478468
if (isSupportedConfigurationFixture(testMethod)) {
479469
final String executableUuid = currentExecutable.get();

0 commit comments

Comments
 (0)