This is an automated email from the ASF dual-hosted git repository.

neilcsmith pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
     new 459c2d1511 Enable 'Rerun failed tests' button for JUnit5
     new a4a69824ad Merge pull request #6217 from 
Atrament666/fix_rerun_failed_button
459c2d1511 is described below

commit 459c2d151118d48bdc92a90155da5a5d8920db79
Author: VladimĂ­r Machat <macha...@gmail.com>
AuthorDate: Tue Jul 18 11:29:21 2023 +0100

    Enable 'Rerun failed tests' button for JUnit5
    
    Fixes #6199
---
 .../maven/junit/JUnitOutputListenerProvider.java        | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git 
a/java/maven.junit/src/org/netbeans/modules/maven/junit/JUnitOutputListenerProvider.java
 
b/java/maven.junit/src/org/netbeans/modules/maven/junit/JUnitOutputListenerProvider.java
index 4cda2cca62..2c04b7406d 100644
--- 
a/java/maven.junit/src/org/netbeans/modules/maven/junit/JUnitOutputListenerProvider.java
+++ 
b/java/maven.junit/src/org/netbeans/modules/maven/junit/JUnitOutputListenerProvider.java
@@ -470,7 +470,9 @@ public class JUnitOutputListenerProvider implements 
OutputProcessor {
                                        return 
usingSurefire28(config.getMavenProject());
                                    } else if 
(usingJUnit4(config.getMavenProject())) { //#214334
                                        return 
usingSurefire2121(config.getMavenProject());
-                                   }
+                                   } else if 
(getJUnitVersion(config.getMavenProject()).equals("JUNIT5")){
+                                        return 
usingSurefire2220(config.getMavenProject());
+                                    }
                                }
                            }
                            return false;
@@ -505,7 +507,12 @@ public class JUnitOutputListenerProvider implements 
OutputProcessor {
     private boolean usingSurefire28(MavenProject prj) {
         String v = PluginPropertyUtils.getPluginVersion(prj, 
Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_SUREFIRE);
         return v != null && new ComparableVersion(v).compareTo(new 
ComparableVersion("2.8")) >= 0;
-    } 
+    }
+
+    private boolean usingSurefire2220(MavenProject prj) {
+        String v = PluginPropertyUtils.getPluginVersion(prj, 
Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_SUREFIRE);
+        return v != null && new ComparableVersion(v).compareTo(new 
ComparableVersion("2.22.0")) >= 0;
+    }
     
      private boolean usingTestNG(MavenProject prj) {
         for (Artifact a : prj.getArtifacts()) {
@@ -528,6 +535,12 @@ public class JUnitOutputListenerProvider implements 
OutputProcessor {
                     return "JUNIT3"; //NOI18N
                 }
             }
+            if ("org.junit.jupiter".equals(a.getGroupId()) && 
"junit-jupiter-api".equals(a.getArtifactId())) {
+                String version = a.getVersion();
+                if (version != null && new 
ComparableVersion(version).compareTo(new ComparableVersion("5.0")) >= 0) {
+                    return "JUNIT5"; //NOI18N
+                }
+            }
         }
         return juVersion;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to