From 56f22fd719fe464c8a080e710de847983bb65ac1 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 22 Apr 2022 00:28:31 +0200 Subject: [PATCH 3/4] Port to JUnit 5.8.1 --- pom.xml | 6 +++--- .../maven/surefire/junitplatform/LazyLauncher.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c261bf3c2..a75e156ce 100644 --- a/pom.xml +++ b/pom.xml @@ -250,17 +250,17 @@ org.junit.platform junit-platform-launcher - 1.3.2 + 1.8.1 org.junit.jupiter junit-jupiter-engine - 5.3.2 + 5.8.1 org.junit.jupiter junit-jupiter-params - 5.3.2 + 5.8.1 org.mockito diff --git a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/LazyLauncher.java b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/LazyLauncher.java index 6a1a3b3b3..dee110e3c 100644 --- a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/LazyLauncher.java +++ b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/LazyLauncher.java @@ -21,6 +21,7 @@ import org.apache.maven.surefire.api.util.ReflectionUtils; import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestPlan; @@ -55,6 +56,19 @@ public void execute( LauncherDiscoveryRequest launcherDiscoveryRequest, launcher().execute( launcherDiscoveryRequest, testExecutionListeners ); } + @Override + public void execute( TestPlan testPlan, + TestExecutionListener... testExecutionListeners ) + { + launcher().execute( testPlan, testExecutionListeners ); + } + + @Override + public void registerLauncherDiscoveryListeners( LauncherDiscoveryListener... launcherDiscoveryListeners ) + { + launcher().registerLauncherDiscoveryListeners( launcherDiscoveryListeners ); + } + private Launcher launcher() { if ( launcher == null ) -- 2.35.1