incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1469767 - in /sling/trunk/contrib/extensions/healthcheck: hc-core/src/main/java/org/apache/sling/hc/api/ hc-core/src/main/java/org/apache/sling/hc/impl/ hc-sling/src/main/java/org/apache/sling/hc/sling/impl/ it/src/test/java/org/apache/sli...
Date Fri, 19 Apr 2013 09:52:06 GMT
Author: bdelacretaz
Date: Fri Apr 19 09:52:05 2013
New Revision: 1469767

URL: http://svn.apache.org/r1469767
Log:
SLING-2822 - rename to 'health check', fix more names

Added:
    sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/HealthCheckFacade.java
      - copied, changed from r1469745, sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/MuppetFacade.java
    sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiHealthCheckFacadeImpl.java
      - copied, changed from r1469745, sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiMuppetFacadeImpl.java
    sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/SlingHealthCheckServlet.java
      - copied, changed from r1469745, sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/MuppetSlingServlet.java
    sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/OsgiHealthCheckFacadeTest.java
      - copied, changed from r1469745, sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/MuppetOsgiFacadeTest.java
Removed:
    sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/MuppetFacade.java
    sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiMuppetFacadeImpl.java
    sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/MuppetSlingServlet.java
    sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/MuppetOsgiFacadeTest.java

Copied: sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/HealthCheckFacade.java
(from r1469745, sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/MuppetFacade.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/HealthCheckFacade.java?p2=sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/HealthCheckFacade.java&p1=sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/MuppetFacade.java&r1=1469745&r2=1469767&rev=1469767&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/MuppetFacade.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/api/HealthCheckFacade.java
Fri Apr 19 09:52:05 2013
@@ -21,8 +21,8 @@ import java.io.IOException;
 import java.io.Reader;
 import java.util.List;
 
-/** Service facade for Muppet */
-public interface MuppetFacade {
+/** Service facade for the health check tool */
+public interface HealthCheckFacade {
     /** Return a new, empty RulesEngine*/
     RulesEngine getNewRulesEngine();
     

Copied: sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiHealthCheckFacadeImpl.java
(from r1469745, sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiMuppetFacadeImpl.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiHealthCheckFacadeImpl.java?p2=sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiHealthCheckFacadeImpl.java&p1=sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiMuppetFacadeImpl.java&r1=1469745&r2=1469767&rev=1469767&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiMuppetFacadeImpl.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/hc-core/src/main/java/org/apache/sling/hc/impl/OSGiHealthCheckFacadeImpl.java
Fri Apr 19 09:52:05 2013
@@ -23,24 +23,24 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.sling.hc.api.MuppetFacade;
+import org.apache.sling.hc.api.HealthCheckFacade;
 import org.apache.sling.hc.api.Rule;
 import org.apache.sling.hc.api.RuleBuilder;
 import org.apache.sling.hc.api.RulesEngine;
 import org.osgi.framework.BundleContext;
 import org.osgi.util.tracker.ServiceTracker;
 
-/** {@link MuppetFacade} for an OSGi environment, where
+/** {@link HealthCheckFacade} for an OSGi environment, where
  *  {@link RuleBuilder} are provided as OSGi services.
  */
-public class OSGiMuppetFacadeImpl implements MuppetFacade {
+public class OSGiHealthCheckFacadeImpl implements HealthCheckFacade {
 
     private TextRulesParser parser;
     private List<RuleBuilder> ruleBuilders;
     private final ServiceTracker ruleBuilderTracker;
     private int trackingCount;
     
-    public OSGiMuppetFacadeImpl(BundleContext ctx) {
+    public OSGiHealthCheckFacadeImpl(BundleContext ctx) {
         ruleBuilderTracker = new ServiceTracker(ctx, RuleBuilder.class.getName(), null);
         ruleBuilderTracker.open();
     }

Copied: sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/SlingHealthCheckServlet.java
(from r1469745, sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/MuppetSlingServlet.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/SlingHealthCheckServlet.java?p2=sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/SlingHealthCheckServlet.java&p1=sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/MuppetSlingServlet.java&r1=1469745&r2=1469767&rev=1469767&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/MuppetSlingServlet.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/hc-sling/src/main/java/org/apache/sling/hc/sling/impl/SlingHealthCheckServlet.java
Fri Apr 19 09:52:05 2013
@@ -26,22 +26,22 @@ import org.apache.felix.scr.annotations.
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
-import org.apache.sling.hc.api.MuppetFacade;
+import org.apache.sling.hc.api.HealthCheckFacade;
 import org.apache.sling.hc.api.RulesEngine;
 import org.apache.sling.hc.sling.api.JsonResultRenderer;
 import org.apache.sling.hc.sling.api.RulesResourceParser;
 
-/** Sling Servlet that renders a Resource that contains Muppet rules definitions,
- *  after evaluating the rules.
+/** Sling Servlet that renders a Resource that contains health check rules 
+ *  definitions, after evaluating the rules.
  *  {@link RulesResourceParser} defines the resource format, and {@link JsonResultRenderer}
  *  defines the output format. 
  */
 @SuppressWarnings("serial")
-@SlingServlet(extensions="json",resourceTypes="sling.hc.rules",methods="GET",selectors="muppet")
-public class MuppetSlingServlet extends SlingSafeMethodsServlet {
+@SlingServlet(extensions="json",resourceTypes="sling/healthcheck/rules",methods="GET",selectors="healthcheck")
+public class SlingHealthCheckServlet extends SlingSafeMethodsServlet {
 
     @Reference
-    private MuppetFacade muppet;
+    private HealthCheckFacade healthcheck;
     
     @Reference
     private RulesResourceParser parser;
@@ -56,7 +56,7 @@ public class MuppetSlingServlet extends 
         // TODO restrict execution to admin?
         
         // TODO we could cache the engine + rules, not sure if it's worth it...
-        final RulesEngine engine = muppet.getNewRulesEngine();
+        final RulesEngine engine = healthcheck.getNewRulesEngine();
         engine.addRules(parser.parseResource(request.getResource()));
         response.setContentType("application/json");
         response.setCharacterEncoding("UTF-8");

Copied: sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/OsgiHealthCheckFacadeTest.java
(from r1469745, sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/MuppetOsgiFacadeTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/OsgiHealthCheckFacadeTest.java?p2=sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/OsgiHealthCheckFacadeTest.java&p1=sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/MuppetOsgiFacadeTest.java&r1=1469745&r2=1469767&rev=1469767&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/MuppetOsgiFacadeTest.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/OsgiHealthCheckFacadeTest.java
Fri Apr 19 09:52:05 2013
@@ -26,7 +26,7 @@ import java.util.List;
 import javax.inject.Inject;
 
 import org.apache.sling.hc.api.EvaluationResult;
-import org.apache.sling.hc.api.MuppetFacade;
+import org.apache.sling.hc.api.HealthCheckFacade;
 import org.apache.sling.hc.api.Rule;
 import org.apache.sling.hc.api.RuleBuilder;
 import org.apache.sling.hc.api.SystemAttribute;
@@ -39,10 +39,10 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
 @RunWith(PaxExam.class)
-public class MuppetOsgiFacadeTest {
+public class OsgiHealthCheckFacadeTest {
     
     @Inject
-    private MuppetFacade facade;
+    private HealthCheckFacade facade;
     
     @Inject
     private BundleContext bundleContext;
@@ -54,15 +54,15 @@ public class MuppetOsgiFacadeTest {
     
     @Test
     public void testFacadePresent() {
-        assertNotNull("Expecting MuppetFacade service to be provided", facade);
+        assertNotNull("Expecting HealthCheckFacade service to be provided", facade);
     }
     
     @Test
     public void testDefaultRules() throws IOException {
         // There should be at least one rule builder, but not a lot
         final String [] rules = { 
-            "muppet:RuleBuilderCount:> 0",
-            "muppet:RuleBuilderCount:> 42"
+            "healthcheck:RuleBuilderCount:> 0",
+            "healthcheck:RuleBuilderCount:> 42"
         };
         final List<EvaluationResult> r = U.evaluateRules(facade, rules);
         
@@ -75,8 +75,8 @@ public class MuppetOsgiFacadeTest {
     @Test
     public void testAddingCustomRule() throws IOException {
         final String [] rules = { 
-            "muppet:RuleBuilderCount:> 0",
-            "muppet:RuleBuilderCount:> 42",
+            "healthcheck:RuleBuilderCount:> 0",
+            "healthcheck:RuleBuilderCount:> 42",
             "test:constant:5",
             "test:constant:12",
         };



Mime
View raw message