You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2012/12/06 22:34:27 UTC

[1/2] git commit: o Simplified logic

Updated Branches:
  refs/heads/master 87fca1e08 -> f1b26856d


o Simplified logic


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/f1b26856
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/f1b26856
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/f1b26856

Branch: refs/heads/master
Commit: f1b26856d19e79415dc546c713db55bccad8c315
Parents: 9cc7b99
Author: Kristian Rosenvold <kr...@apache.org>
Authored: Thu Dec 6 22:34:11 2012 +0100
Committer: Kristian Rosenvold <kr...@apache.org>
Committed: Thu Dec 6 22:34:11 2012 +0100

----------------------------------------------------------------------
 .../maven/plugin/surefire/SurefireHelper.java      |   21 ++++++++------
 1 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/f1b26856/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
index fdbe9bb..2af5fa8 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
@@ -44,19 +44,22 @@ public final class SurefireHelper
 
         boolean timeoutOrOtherFailure = result.isFailureOrTimeout();
 
-        if ( !timeoutOrOtherFailure && result.getCompletedCount() == 0 )
+        if ( !timeoutOrOtherFailure )
         {
-            if ( ( reportParameters.getFailIfNoTests() == null ) || !reportParameters.getFailIfNoTests() )
+            if ( result.getCompletedCount() == 0 )
             {
-                return;
+                if ( ( reportParameters.getFailIfNoTests() == null ) || !reportParameters.getFailIfNoTests() )
+                {
+                    return;
+                }
+                throw new MojoFailureException(
+                    "No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.)" );
             }
-            throw new MojoFailureException(
-                "No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.)" );
-        }
 
-        if ( !timeoutOrOtherFailure && result.isErrorFree() )
-        {
-            return;
+            if ( result.isErrorFree() )
+            {
+                return;
+            }
         }
 
         String msg = timeoutOrOtherFailure