juergen 2002/08/19 05:11:13
Modified:
testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor
StringResponseBodyAssert.java
Log:
fixed a bug in case of xml differences.
Revision Changes Path
1.2 +12 -32
jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/StringResponseBodyAssert.java
Index: StringResponseBodyAssert.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/StringResponseBodyAssert.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StringResponseBodyAssert.java 19 Aug 2002 11:12:17 -0000 1.1
+++ StringResponseBodyAssert.java 19 Aug 2002 12:11:13 -0000 1.2
@@ -83,35 +83,14 @@
public abstract class StringResponseBodyAssert extends StreamResponseBodyAssert{
- private final static boolean extendedPrintlnsrequested = true;
-
-
- protected HttpMethod method;
- protected InputStream expectedBody;
- protected InputStream receivedBody;
+ private final static boolean extendedPrintlnsrequested = false;
+
/** constructer
* @param WebdavMethodBase Element
*/
public StringResponseBodyAssert(HttpMethod method, InputStream expectedBody,
XConf xconf, XMLOutput xmlresult){
-
-
super(method, expectedBody, xconf, xmlresult);
-
- this.method = method;
- this.expectedBody = expectedBody;
- // ugly quick hack to read the body
- try {
- if (method.hasResponseBody() && method instanceof GetMethod) {
- this.receivedBody = ((GetMethod)method).getData();
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- xmlresult.writeException(e);
- }
-
-
}
@@ -148,10 +127,8 @@
String contentValueProblem = null;
int charsRead = 0;
- while (charsRead <= receivedBody.length() &&
- charsRead <= expectedBody.length()) {
-
- charsRead++;
+ while (charsRead < receivedBody.length() &&
+ charsRead < expectedBody.length()) {
char receivedChar = receivedBody.charAt(charsRead);
char expectedChar = expectedBody.charAt(charsRead);
@@ -166,7 +143,9 @@
contentValueProblem += " ," + charsRead;
}
}
- }
+
+ charsRead++;
+ }
if (contentValueProblem != null) {
xmlresult.writeElement("ContentValueError", contentValueProblem);
@@ -201,4 +180,5 @@
}
+
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>