Author: rwesten
Date: Tue Feb 14 08:52:58 2012
New Revision: 1243830
URL: http://svn.apache.org/viewvc?rev=1243830&view=rev
Log:
The assertStatus now prints the content if the assertion fails to the logs.
This usually helps debugging because it will print the error message sent by
the server to the log.
Modified:
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java
Modified:
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java?rev=1243830&r1=1243829&r2=1243830&view=diff
==============================================================================
---
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java
(original)
+++
incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java
Tue Feb 14 08:52:58 2012
@@ -147,7 +147,9 @@ public class RequestExecutor {
*/
public RequestExecutor assertStatus(int expected) {
assertNotNull(this.toString(), response);
- assertEquals(this + ": expecting status " + expected, expected,
response.getStatusLine().getStatusCode());
+ int status = response.getStatusLine().getStatusCode();
+ assertEquals(this + ": expecting status " + expected
+ + " (content: "+content+")", expected, status);
return this;
}