sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-org-apache-sling-hc-junit-bridge] 03/20: SLING-3771 - fail if no HCs found
Date Fri, 20 Oct 2017 14:38:31 GMT
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hc-junit-bridge.git

commit e8a871cd0b4f464930ffc9be879dd7f68f88dd9f
Author: Bertrand Delacretaz <bdelacretaz@apache.org>
AuthorDate: Fri Jul 18 13:02:58 2014 +0000

    SLING-3771 - fail if no HCs found
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1611636 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java b/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java
index c611c40..412d2d2 100644
--- a/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java
+++ b/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java
@@ -17,7 +17,11 @@
  */
 package org.apache.sling.hc.junitbridge;
 
+import static org.junit.Assert.fail;
 import static org.junit.Assert.assertNotNull;
+
+import java.util.Arrays;
+
 import junit.framework.TestSuite;
 
 import org.junit.runner.RunWith;
@@ -39,6 +43,9 @@ public class JUnitTestBridge {
         for(ServiceReference ref : context.getFilter().getTaggedHealthCheckServiceReferences(context.getTags()))
{
             suite.addTest(new HealthCheckTest(context, ref));
         }
+        if(suite.countTestCases() == 0) {
+            fail("No Health Checks found with tags " + Arrays.asList(context.getTags()));
+        }
         return suite;
     }
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Mime
View raw message