You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/20 14:38:30 UTC

[sling-org-apache-sling-hc-junit-bridge] 02/20: SLING-3771 - descriptive default config

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 d597b295cee0a507bdf1f2c72b0c3cf57fb12665
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jul 18 13:00:22 2014 +0000

    SLING-3771 - descriptive default config
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1611635 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/hc/junitbridge/HealthCheckTestsProvider.java     | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/hc/junitbridge/HealthCheckTestsProvider.java b/src/main/java/org/apache/sling/hc/junitbridge/HealthCheckTestsProvider.java
index 7008aa2..c1053c8 100644
--- a/src/main/java/org/apache/sling/hc/junitbridge/HealthCheckTestsProvider.java
+++ b/src/main/java/org/apache/sling/hc/junitbridge/HealthCheckTestsProvider.java
@@ -30,8 +30,6 @@ import org.apache.sling.junit.TestsProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.service.component.ComponentContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /** Bridge Health Checks into the Sling JUnit server-side test
  *  framework, based on their tags.
@@ -44,10 +42,12 @@ public class HealthCheckTestsProvider implements TestsProvider {
     private long lastModified;
     private BundleContext bundleContext;
     
-    private final Logger log = LoggerFactory.getLogger(getClass());
-    
     public static final String TEST_NAME_PREFIX = "HealthChecks(";
     public static final String TEST_NAME_SUFFIX = ")";
+    
+    public static final String [] DEFAULT_TAG_GROUPS = {
+        "No tag groups configured"
+    };
 
     @Property(cardinality=2147483647, 
             label="Health Check Tags",
@@ -59,11 +59,7 @@ public class HealthCheckTestsProvider implements TestsProvider {
     @Activate
     protected void activate(ComponentContext ctx) {
         bundleContext = ctx.getBundleContext();
-        tagGroups = PropertiesUtil.toStringArray(ctx.getProperties().get(PROP_TAG_GROUPS));
-        if(tagGroups == null) {
-            tagGroups = new String[]{};
-            log.warn("No tag groups configured via {}, Health Checks won't be available as JUnit tests", PROP_TAG_GROUPS);
-        }
+        tagGroups = PropertiesUtil.toStringArray(ctx.getProperties().get(PROP_TAG_GROUPS), DEFAULT_TAG_GROUPS);
         servicePid = (String)ctx.getProperties().get(Constants.SERVICE_PID);
         lastModified = System.currentTimeMillis();
     }

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