You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2021/05/14 20:48:35 UTC

[maven-surefire] branch SUREFIRE-1910 updated: renamed enum

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

tibordigana pushed a commit to branch SUREFIRE-1910
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/SUREFIRE-1910 by this push:
     new 3e8c224  renamed enum
3e8c224 is described below

commit 3e8c22489648e06a520771c5b857088bad0e565b
Author: tibordigana <ti...@gmail.com>
AuthorDate: Fri May 14 20:48:26 2021 +0200

    renamed enum
---
 .../plugin/surefire/AbstractSurefireMojo.java      | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 51fcb73..f45f5d1 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -151,9 +151,9 @@ import static org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWit
 import static org.apache.maven.surefire.api.util.ReflectionUtils.tryGetMethod;
 import static org.apache.maven.surefire.api.booter.ProviderParameterNames.INCLUDE_JUNIT5_ENGINES_PROP;
 import static org.apache.maven.surefire.api.booter.ProviderParameterNames.EXCLUDE_JUNIT5_ENGINES_PROP;
-import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.NoTestsFailureReason.NO_FAILURE;
-import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.NoTestsFailureReason.NO_SPECIFIED_TESTS_RUN;
-import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.NoTestsFailureReason.NO_TESTS_RUN;
+import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.PluginFailureReason.NONE;
+import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.PluginFailureReason.COULD_NOT_RUN_SPECIFIED_TESTS;
+import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.PluginFailureReason.COULD_NOT_RUN_DEFAULT_TESTS;
 
 /**
  * Abstract base class for running tests using Surefire.
@@ -931,10 +931,10 @@ public abstract class AbstractSurefireMojo
             {
                 switch ( getEffectiveFailIfNoTests() )
                 {
-                    case NO_TESTS_RUN:
+                    case COULD_NOT_RUN_DEFAULT_TESTS:
                         throw new MojoFailureException(
                             "No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.)" );
-                    case NO_SPECIFIED_TESTS_RUN:
+                    case COULD_NOT_RUN_SPECIFIED_TESTS:
                         throw new MojoFailureException( "No tests matching pattern \""
                             + getSpecificTests().toString()
                             + "\" were executed! (Set "
@@ -1848,15 +1848,15 @@ public abstract class AbstractSurefireMojo
         return runOrders.contains( RunOrder.BALANCED ) || runOrders.contains( RunOrder.FAILEDFIRST );
     }
 
-    private NoTestsFailureReason getEffectiveFailIfNoTests()
+    private PluginFailureReason getEffectiveFailIfNoTests()
     {
         if ( isSpecificTestSpecified() )
         {
-            return getFailIfNoSpecifiedTests() ? NO_SPECIFIED_TESTS_RUN : NO_FAILURE;
+            return getFailIfNoSpecifiedTests() ? COULD_NOT_RUN_SPECIFIED_TESTS : NONE;
         }
         else
         {
-            return getFailIfNoTests() ? NO_TESTS_RUN : NO_FAILURE;
+            return getFailIfNoTests() ? COULD_NOT_RUN_DEFAULT_TESTS : NONE;
         }
     }
 
@@ -4205,12 +4205,12 @@ public abstract class AbstractSurefireMojo
     }
 
     /**
-     * No tests run failures.
+     * Determines whether the plugin should fail if no tests found to run.
      */
-    enum NoTestsFailureReason
+    enum PluginFailureReason
     {
-        NO_FAILURE,
-        NO_SPECIFIED_TESTS_RUN,
-        NO_TESTS_RUN,
+        NONE,
+        COULD_NOT_RUN_SPECIFIED_TESTS,
+        COULD_NOT_RUN_DEFAULT_TESTS,
     }
 }