Author: markt
Date: Sun Nov 11 23:48:19 2012
New Revision: 1408157
URL: http://svn.apache.org/viewvc?rev=1408157&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/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1408156
Modified:
tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java?rev=1408157&r1=1408156&r2=1408157&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
(original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/SimpleHttpClient.java
Sun Nov 11 23:48:19 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: [email protected]
For additional commands, e-mail: [email protected]