sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1611636 - /sling/trunk/bundles/extensions/healthcheck/junit-bridge/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java
Date Fri, 18 Jul 2014 13:02:59 GMT
Author: bdelacretaz
Date: Fri Jul 18 13:02:58 2014
New Revision: 1611636

URL: http://svn.apache.org/r1611636
Log:
SLING-3771 - fail if no HCs found

Modified:
    sling/trunk/bundles/extensions/healthcheck/junit-bridge/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java

Modified: sling/trunk/bundles/extensions/healthcheck/junit-bridge/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/junit-bridge/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java?rev=1611636&r1=1611635&r2=1611636&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/junit-bridge/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/junit-bridge/src/main/java/org/apache/sling/hc/junitbridge/JUnitTestBridge.java
Fri Jul 18 13:02:58 2014
@@ -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



Mime
View raw message