hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r291206 - /jakarta/httpclient/trunk/coyote-httpconnector/src/tests/tests/performance/PerformanceTest.java
Date Fri, 23 Sep 2005 21:45:35 GMT
Author: olegk
Date: Fri Sep 23 14:45:32 2005
New Revision: 291206

URL: http://svn.apache.org/viewcvs?rev=291206&view=rev
Log:
Do not use EntityConsumer in performance tests

Modified:
    jakarta/httpclient/trunk/coyote-httpconnector/src/tests/tests/performance/PerformanceTest.java

Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/tests/tests/performance/PerformanceTest.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/tests/tests/performance/PerformanceTest.java?rev=291206&r1=291205&r2=291206&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/tests/tests/performance/PerformanceTest.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/tests/tests/performance/PerformanceTest.java
Fri Sep 23 14:45:32 2005
@@ -30,6 +30,7 @@
 package tests.performance;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.util.Random;
@@ -43,7 +44,6 @@
 import org.apache.http.HttpVersion;
 import org.apache.http.Protocol;
 import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.entity.EntityConsumer;
 import org.apache.http.executor.HttpRequestExecutor;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.impl.DefaultHttpParams;
@@ -125,8 +125,10 @@
             try {
                 long start = System.nanoTime();
                 HttpResponse response = this.httpexecutor.execute(request, conn);
-                // Consume as string
-                EntityConsumer.toString(response.getEntity());
+				InputStream instream = response.getEntity().getContent();
+                byte[] buffer = new byte[4096];
+                while (instream.read(buffer) > 0) {
+                }
                 long t = System.nanoTime() - start;
                 total += t;
             } catch (IOException ex) {



Mime
View raw message