juergen 02/05/14 08:41:23
Modified:
testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor
TProcessors.java
Log:
1) for a propPatch method the encoding was lost.
2) parse an XML string with a reader.
Revision Changes Path
1.20 +10 -13
jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java
Index: TProcessors.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- TProcessors.java 25 Apr 2002 21:15:13 -0000 1.19
+++ TProcessors.java 14 May 2002 15:41:22 -0000 1.20
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v
1.19 2002/04/25 21:15:13 jericho Exp $
- * $Revision: 1.19 $
- * $Date: 2002/04/25 21:15:13 $
+ * $Header:
/home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v
1.20 2002/05/14 15:41:22 juergen Exp $
+ * $Revision: 1.20 $
+ * $Date: 2002/05/14 15:41:22 $
*
* ====================================================================
*
@@ -74,7 +74,7 @@
import org.apache.util.URLUtil;
// jdom
import org.jdom.*;
-import org.jdom.input.*;
+import org.jdom.input.SAXBuilder;
import org.jdom.output.*;
//test package
import org.apache.slide.testsuite.testtools.tutil.*;
@@ -84,7 +84,7 @@
* Main class to performe a test case and check and report the results
*
* @author Software AG
- * @version $Revision: 1.19 $
+ * @version $Revision: 1.20 $
*/
public class TProcessors {
@@ -813,12 +813,13 @@
}
else {
try {
- byte[] input =
replaceKnownVariable(element).getBytes(getFileEncoding(element));
- method.setHeader("Content-Length", ""+input.length);
+ String source = replaceKnownVariable(element);
if (method instanceof PutMethod) {
+ byte[] input = source.getBytes(getFileEncoding(element));
+ method.setHeader("Content-Length", ""+input.length);
((PutMethod)method).sendData(input);
} else {
- method.setQuery(new String(input)); // we lost the encoding
here!!!!
+ method.setQuery(source);
}
}
catch (UnsupportedEncodingException e) { throw new
Exception(e.toString());}
@@ -1088,12 +1089,8 @@
if (input.trim().equals("")) return null;
try {
- // WAM get rid of deprecated StringBufferInputStream
- // result = (new org.jdom.input.DOMBuilder().build
- // (new
StringBufferInputStream(element.trim()))).getRootElement();
- result = (new org.jdom.input.DOMBuilder().build
- (new ByteArrayInputStream
(input.trim().getBytes()))).getRootElement();
+ result = (new SAXBuilder().build(new
StringReader(input.trim()))).getRootElement();
}
catch (Exception e){
System.out.println("#####################");
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>