From 745cfcb1617cda2763e6e58d88889885883b7822 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 9 May 2020 17:36:25 +0200 Subject: [PATCH] Upgrade tests to TestNG 7.1 See gh-24298 --- .../context/cache/ClassLevelDirtiesContextTestNGTests.java | 5 ++--- .../junit4/FailingBeforeAndAfterMethodsTestNGTests.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/context/cache/ClassLevelDirtiesContextTestNGTests.java b/spring-test/src/test/java/org/springframework/test/context/cache/ClassLevelDirtiesContextTestNGTests.java index c9cad8f854..dc8bea455a 100644 --- a/spring-test/src/test/java/org/springframework/test/context/cache/ClassLevelDirtiesContextTestNGTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/cache/ClassLevelDirtiesContextTestNGTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.testng.ITestNGListener; import org.testng.TestNG; import org.springframework.beans.factory.annotation.Autowired; @@ -140,7 +139,7 @@ class ClassLevelDirtiesContextTestNGTests { final TrackingTestNGTestListener listener = new TrackingTestNGTestListener(); final TestNG testNG = new TestNG(); - testNG.addListener((ITestNGListener) listener); + testNG.addListener(listener); testNG.setTestClasses(new Class[] { testClass }); testNG.setVerbose(0); testNG.run(); diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTestNGTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTestNGTests.java index 916365eae3..c14cc3afa3 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTestNGTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/FailingBeforeAndAfterMethodsTestNGTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.testng.ITestNGListener; import org.testng.TestNG; import org.springframework.test.context.ContextConfiguration; @@ -97,7 +96,7 @@ public class FailingBeforeAndAfterMethodsTestNGTests { public void runTestAndAssertCounters() throws Exception { TrackingTestNGTestListener listener = new TrackingTestNGTestListener(); TestNG testNG = new TestNG(); - testNG.addListener((ITestNGListener) listener); + testNG.addListener(listener); testNG.setTestClasses(new Class[] {this.clazz}); testNG.setVerbose(0); testNG.run();