You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2002/06/15 12:59:33 UTC
cvs commit: jakarta-cactus/framework/src/java/share/org/apache/cactus/client WebTestResultParser.java
vmassol 2002/06/15 03:59:33
Modified: framework/src/java/share/org/apache/cactus/client
WebTestResultParser.java
Log:
supposed to correct bug reported by Daniel Dennison on http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9544
Revision Changes Path
1.3 +9 -5 jakarta-cactus/framework/src/java/share/org/apache/cactus/client/WebTestResultParser.java
Index: WebTestResultParser.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/WebTestResultParser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WebTestResultParser.java 1 May 2002 19:52:27 -0000 1.2
+++ WebTestResultParser.java 15 Jun 2002 10:59:33 -0000 1.3
@@ -126,11 +126,15 @@
String endRootString = "</" + WebTestResult.XML_ROOT_ELEMENT + ">";
String buffer;
- if (theData.startsWith(startRootString) &&
- theData.endsWith(endRootString)) {
+ // It is possible that some end of line character are inserted at the end of the
+ // string. This is valid, which is why we trim teh string before perfoming the checks.
+ String trimmedData = theData.trim();
- buffer = theData.substring(startRootString.length(),
- theData.length() - endRootString.length());
+ if (trimmedData.startsWith(startRootString) &&
+ trimmedData.endsWith(endRootString)) {
+
+ buffer = trimmedData.substring(startRootString.length(),
+ trimmedData.length() - endRootString.length());
} else {
throw new ParsingException("Not a valid response");
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>