juergen 02/02/26 10:29:21
Modified:
testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor
TProcessors.java
Log:
set the content length now explicitely in the test suite.
Revision Changes Path
1.11 +13 -6
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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- TProcessors.java 25 Feb 2002 09:54:57 -0000 1.10
+++ TProcessors.java 26 Feb 2002 18:29:21 -0000 1.11
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v
1.10 2002/02/25 09:54:57 juergen Exp $
- * $Revision: 1.10 $
- * $Date: 2002/02/25 09:54:57 $
+ * $Header:
/home/cvs/jakarta-slide/testsuite/testsuite/junit/src/org/apache/slide/testsuite/testtools/tprocessor/TProcessors.java,v
1.11 2002/02/26 18:29:21 juergen Exp $
+ * $Revision: 1.11 $
+ * $Date: 2002/02/26 18:29:21 $
*
* ====================================================================
*
@@ -84,7 +84,7 @@
* Main class to performe a test case and check and report the results
*
* @author Software AG
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public class TProcessors {
@@ -786,10 +786,17 @@
*/
private HttpMethod fillBody (Element element, HttpMethod method) throws
Exception {
if (method instanceof PutMethod && binaryReadRequest(element)) {
- ((PutMethod)method).sendData(new File(getFileReferenceName(element)));
+ File input = new File(getFileReferenceName(element));
+ method.setHeader("Content-Length", ""+input.length());
+ ((PutMethod)method).sendData(input);
}
else {
- method.setQuery(replaceKnownVariable(element));
+ try {
+ byte[] input =
replaceKnownVariable(element).getBytes(getFileEncoding(element));
+ method.setHeader("Content-Length", ""+input.length);
+ ((PutMethod)method).sendData(input);
+ }
+ catch (UnsupportedEncodingException e) { throw new
Exception(e.toString());}
}
return method;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>