This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hc.it-1.0.4
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hc-it.git

commit cc574437f71502bfb2d6204817b3c86f7699ff86
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Mon Aug 12 16:22:26 2013 +0000

    SLING-2987 - split into several bundles
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/healthcheck/it@1513189
 13f79535-47bb-0310-9956-ffa450edef68
---
 ...electorTest.java => HealthCheckFilterTest.java} | 124 +++++++++++----------
 src/test/java/org/apache/sling/hc/it/core/U.java   |   3 +-
 2 files changed, 70 insertions(+), 57 deletions(-)

diff --git 
a/src/test/java/org/apache/sling/hc/it/core/HealthCheckSelectorTest.java 
b/src/test/java/org/apache/sling/hc/it/core/HealthCheckFilterTest.java
similarity index 72%
rename from 
src/test/java/org/apache/sling/hc/it/core/HealthCheckSelectorTest.java
rename to src/test/java/org/apache/sling/hc/it/core/HealthCheckFilterTest.java
index ac9d595..0e57b92 100644
--- a/src/test/java/org/apache/sling/hc/it/core/HealthCheckSelectorTest.java
+++ b/src/test/java/org/apache/sling/hc/it/core/HealthCheckFilterTest.java
@@ -34,7 +34,7 @@ import javax.inject.Inject;
 import org.apache.sling.hc.api.Constants;
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.api.Result;
-import org.apache.sling.hc.util.HealthCheckSelector;
+import org.apache.sling.hc.util.HealthCheckFilter;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -48,52 +48,54 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @RunWith(PaxExam.class)
-public class HealthCheckSelectorTest {
-    
+public class HealthCheckFilterTest {
+
     private final Logger log = LoggerFactory.getLogger(getClass());
-    
-    @Inject
-    private HealthCheckSelector selector;
-    
+
+    private HealthCheckFilter filter;
+
     @Inject
     private BundleContext bundleContext;
-    
+
     private List<TestHealthCheck> testServices = new 
ArrayList<TestHealthCheck>();
     private static int instanceCounter = 0;
-    
+
     class TestHealthCheck implements HealthCheck {
 
         private final int id;
         private final ServiceRegistration<?> reg;
-        final String [] tags;
-        
-        TestHealthCheck(String ... tags) {
+        final String[] tags;
+
+        TestHealthCheck(String... tags) {
             id = instanceCounter++;
             this.tags = tags;
             final Dictionary<String, Object> props = new Hashtable<String, 
Object>();
-            if(tags != null) {
+            if (tags != null) {
                 props.put(Constants.HC_TAGS, tags);
             }
             props.put(Constants.HC_TAGS, tags);
-            reg = bundleContext.registerService(HealthCheck.class.getName(), 
this, props);
-            log.info("Registered {} with {}={}", new Object[] { this, 
Constants.HC_TAGS, props.get(Constants.HC_TAGS)});
+            reg = bundleContext.registerService(HealthCheck.class.getName(),
+                    this, props);
+            log.info("Registered {} with {}={}", new Object[] { this,
+                    Constants.HC_TAGS, props.get(Constants.HC_TAGS) });
         }
-        
+
         @Override
         public String toString() {
             return Arrays.asList(tags).toString();
         }
-        
+
         @Override
         public boolean equals(Object other) {
-            return other instanceof TestHealthCheck && 
((TestHealthCheck)other).id == id;
+            return other instanceof TestHealthCheck
+                    && ((TestHealthCheck) other).id == id;
         }
-        
+
         @Override
         public int hashCode() {
             return id;
         }
-        
+
         @Override
         public Result execute() {
             return null;
@@ -103,17 +105,17 @@ public class HealthCheckSelectorTest {
         public Map<String, String> getInfo() {
             return null;
         }
-        
+
         void unregister() {
             reg.unregister();
         }
     }
-    
+
     @Configuration
     public Option[] config() {
         return U.config();
     }
-    
+
     @Before
     public void setup() {
         testServices.add(new TestHealthCheck("foo"));
@@ -121,96 +123,106 @@ public class HealthCheckSelectorTest {
         testServices.add(new TestHealthCheck("foo", "bar"));
         testServices.add(new TestHealthCheck("other", "thing"));
         testServices.add(new TestHealthCheck());
+        filter = new HealthCheckFilter(bundleContext);
     }
-    
+
     @After
     public void cleanup() {
-        for(TestHealthCheck tc : testServices) {
+        for (TestHealthCheck tc : testServices) {
             tc.unregister();
         }
     }
-    
-    /** @param included true or false, in the same order as testServices */
-    private void assertServices(List<HealthCheck> s, boolean ... included) {
+
+    /**
+     * @param included
+     *            true or false, in the same order as testServices
+     */
+    private void assertServices(List<HealthCheck> s, boolean... included) {
         final Iterator<TestHealthCheck> it = testServices.iterator();
-        for(boolean inc : included) {
+        for (boolean inc : included) {
             final TestHealthCheck thc = it.next();
-            if(inc) {
-                assertTrue("Expecting list of services to include " + thc, 
s.contains(thc));
+            if (inc) {
+                assertTrue("Expecting list of services to include " + thc,
+                        s.contains(thc));
             } else {
-                assertFalse("Not expecting list of services to include " + 
thc, s.contains(thc));
+                assertFalse("Not expecting list of services to include " + thc,
+                        s.contains(thc));
             }
         }
     }
-    
+
     @Test
     public void testSelectorService() {
-        assertNotNull("Expecting HealthCheckSelector service to be provided", 
selector);
+        assertNotNull("Expecting HealthCheckSelector service to be provided",
+                filter);
     }
-    
+
     @Test
     public void testAllServices() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck();
+        final List<HealthCheck> s = filter.getTaggedHealthCheck();
         assertServices(s, true, true, true, true, true);
     }
-    
+
     @Test
     public void testEmptyTags() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("","","");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("", "", "");
         assertServices(s, true, true, true, true, true);
     }
-    
+
     @Test
     public void testFooTag() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("foo");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("foo");
         assertServices(s, true, false, true, false, false);
     }
-    
+
     @Test
     public void testBarTag() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("bar");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("bar");
         assertServices(s, false, true, true, false, false);
     }
-    
+
     @Test
     public void testFooAndBar() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("foo", 
"bar");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("foo", "bar");
         assertServices(s, false, false, true, false, false);
     }
-    
+
     @Test
     public void testFooMinusBar() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("foo", 
"-bar");
+        final List<HealthCheck> s = filter
+                .getTaggedHealthCheck("foo", "-bar");
         assertServices(s, true, false, false, false, false);
     }
-    
+
     @Test
     public void testWhitespace() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("\t \n\r foo 
 \t", "", " \t-bar\n", "");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck(
+                "\t \n\r foo  \t", "", " \t-bar\n", "");
         assertServices(s, true, false, false, false, false);
     }
-    
+
     @Test
     public void testOther() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("other");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("other");
         assertServices(s, false, false, false, true, false);
     }
-    
+
     @Test
     public void testMinusOther() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("-other");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("-other");
         assertServices(s, true, true, true, false, true);
     }
-    
+
     @Test
     public void testMinusOtherFoo() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("-other", 
"-foo");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("-other",
+                "-foo");
         assertServices(s, false, true, false, false, true);
     }
-    
+
     @Test
     public void testNoResults() {
-        final List<HealthCheck> s = selector.getTaggedHealthCheck("NOT A TAG");
+        final List<HealthCheck> s = filter.getTaggedHealthCheck("NOT A TAG");
         assertTrue("Expecting no services", s.isEmpty());
     }
 }
diff --git a/src/test/java/org/apache/sling/hc/it/core/U.java 
b/src/test/java/org/apache/sling/hc/it/core/U.java
index 8407902..50f08d5 100644
--- a/src/test/java/org/apache/sling/hc/it/core/U.java
+++ b/src/test/java/org/apache/sling/hc/it/core/U.java
@@ -53,13 +53,14 @@ public class U {
                     mavenBundle("org.apache.sling", 
"org.apache.sling.jcr.jcr-wrapper", "2.0.0"),
                     mavenBundle("org.apache.sling", "org.apache.sling.api", 
"2.4.2"),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.jcr.api", "2.1.0"),
-                    mavenBundle("org.apache.sling", "org.apache.sling.engine", 
"2.2.0"),
+                    mavenBundle("org.apache.sling", "org.apache.sling.engine", 
"2.2.8"),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.auth.core", "1.1.2"),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.commons.mime", "2.1.4"),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.settings", "1.2.2"),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.launchpad.api", "1.1.0"),
                     mavenBundle("commons-collections", "commons-collections", 
"3.2.1"),
                     mavenBundle("commons-io", "commons-io", "1.4"),
+                    mavenBundle("commons-fileupload", "commons-fileupload", 
"1.2.2"),
                     mavenBundle("org.mortbay.jetty", "servlet-api-2.5", 
"6.1.14")
             )
         );

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to