You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/11/12 00:47:35 UTC
svn commit: r1408156 -
/tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
Author: markt
Date: Sun Nov 11 23:47:34 2012
New Revision: 1408156
URL: http://svn.apache.org/viewvc?rev=1408156&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54115
Minor enhancements to HttpClient test helper class
Patch by Brian Burch
Modified:
tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
Modified: tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java?rev=1408156&r1=1408155&r2=1408156&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java Sun Nov 11 23:47:34 2012
@@ -103,6 +103,9 @@ public abstract class SimpleHttpClient {
request = theRequest;
}
+ /*
+ * Expect the server to reply with 100 Continue interim response
+ */
public void setUseContinue(boolean theUseContinueFlag) {
useContinue = theUseContinueFlag;
}
@@ -135,6 +138,10 @@ public abstract class SimpleHttpClient {
return responseBody;
}
+ public List<String> getResponseBodyUriElements() {
+ return bodyUriElments;
+ }
+
public void setUseContentLength(boolean b) {
useContentLength = b;
}
@@ -180,17 +187,23 @@ public abstract class SimpleHttpClient {
}
+ /*
+ * Send the component parts of the request
+ * (be tolerant and simply skip null entries)
+ */
public void sendRequest() throws InterruptedException, IOException {
- // Send the request
boolean first = true;
for (String requestPart : request) {
- if (first) {
- first = false;
- } else {
- Thread.sleep(requestPause);
+ if (requestPart != null) {
+ if (first) {
+ first = false;
+ }
+ else {
+ Thread.sleep(requestPause);
+ }
+ writer.write(requestPart);
+ writer.flush();
}
- writer.write(requestPart);
- writer.flush();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org