incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1052297 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest.java
Date Thu, 23 Dec 2010 15:17:20 GMT
Author: bdelacretaz
Date: Thu Dec 23 15:17:18 2010
New Revision: 1052297

URL: http://svn.apache.org/viewvc?rev=1052297&view=rev
Log:
avoid NPE on failing test

Modified:
    sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest.java

Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest.java?rev=1052297&r1=1052296&r2=1052297&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest.java
(original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest.java
Thu Dec 23 15:17:18 2010
@@ -24,8 +24,14 @@ public class FiltersTest extends HttpTes
 
     public void testCounters() throws IOException {
         HttpMethod get = assertHttpStatus(HTTP_BASE_URL + "/index.html", HttpServletResponse.SC_OK);
-        assertEquals("Filter-set header has incorrect value.", "1", get.getResponseHeader("FILTER_COUNTER_HTTPSERVICE").getValue());
-        assertEquals("Filter-set header has incorrect value.", "1", get.getResponseHeader("FILTER_COUNTER_SLING").getValue());
-        assertEquals("Filter-set header has incorrect value.", "1", get.getResponseHeader("FILTER_COUNTER_NOPROP").getValue());
+        final String [] headers = {
+            "FILTER_COUNTER_HTTPSERVICE",
+            "FILTER_COUNTER_SLING",
+            "FILTER_COUNTER_NOPROP"
+        };
+        for(String header : headers) {
+            assertNotNull("Expecting header '" + header + "'", get.getResponseHeader(header));
+            assertEquals("Expecting value 1 for header '" + header + "'", "1", get.getResponseHeader(header).getValue());
+        }
     }
 }



Mime
View raw message