incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1513457 - /sling/trunk/contrib/extensions/healthcheck/api/src/test/java/org/apache/sling/hc/api/ResultTest.java
Date Tue, 13 Aug 2013 12:28:16 GMT
Author: bdelacretaz
Date: Tue Aug 13 12:28:16 2013
New Revision: 1513457

URL: http://svn.apache.org/r1513457
Log:
SLING-2987 - can't beat paranoia

Modified:
    sling/trunk/contrib/extensions/healthcheck/api/src/test/java/org/apache/sling/hc/api/ResultTest.java

Modified: sling/trunk/contrib/extensions/healthcheck/api/src/test/java/org/apache/sling/hc/api/ResultTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/api/src/test/java/org/apache/sling/hc/api/ResultTest.java?rev=1513457&r1=1513456&r2=1513457&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/api/src/test/java/org/apache/sling/hc/api/ResultTest.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/api/src/test/java/org/apache/sling/hc/api/ResultTest.java
Tue Aug 13 12:28:16 2013
@@ -111,4 +111,26 @@ public class ResultTest {
         r.setStatus(Result.Status.WARN);
         assertEquals("Still expecting CRITICAL status after setting it to WARN", Result.Status.CRITICAL,
r.getStatus());
     }
+    
+    @Test
+    public void testOkIsConsistent() {
+        {
+            final Result r = new Result();
+            assertTrue(r.isOk());
+            r.setStatus(Result.Status.OK);
+            assertTrue("Expecting isOk for OK Status", r.isOk());
+        }
+        
+        final Result.Status [] ts = {
+            Result.Status.WARN,
+            Result.Status.CRITICAL,
+            Result.Status.HEALTH_CHECK_ERROR
+        };
+
+        for(Result.Status s : ts) {
+            final Result r = new Result();
+            r.setStatus(s);
+            assertFalse("Expecting isOk fales for " + s + " Status", r.isOk());
+        }
+    }
 }



Mime
View raw message