incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r634564 - /incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
Date Fri, 07 Mar 2008 07:03:43 GMT
Author: bdelacretaz
Date: Thu Mar  6 23:03:42 2008
New Revision: 634564

URL: http://svn.apache.org/viewvc?rev=634564&view=rev
Log:
Add content in failure messages when HTTP status is not as expected

Modified:
    incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java

Modified: incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java?rev=634564&r1=634563&r2=634564&view=diff
==============================================================================
--- incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
(original)
+++ incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/HttpTestBase.java
Thu Mar  6 23:03:42 2008
@@ -268,7 +268,8 @@
             get.setQueryString(params.toArray(nvp));
         }
         final int status = httpClient.executeMethod(get);
-        assertEquals("Expected status 200 for " + url,200,status);
+        final String content = get.getResponseBodyAsString();
+        assertEquals("Expected status 200 for " + url + " (content=" + content + ")",200,status);
         final Header h = get.getResponseHeader("Content-Type");
         if(expectedContentType == null) {
             if(h!=null) {
@@ -286,7 +287,7 @@
                 h.getValue().startsWith(expectedContentType)
             );
         }
-        return get.getResponseBodyAsString();
+        return content;
     }
 
     /** upload rendering test script, and return its URL for future deletion */



Mime
View raw message