hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r280139 - /jakarta/httpclient/trunk/coyote-httpconnector/src/tests/tests/performance/PerformanceTest.java
Date Sun, 11 Sep 2005 13:57:35 GMT
Author: olegk
Date: Sun Sep 11 06:57:31 2005
New Revision: 280139

URL: http://svn.apache.org/viewcvs?rev=280139&view=rev
Log:
Changed to support classic IO mode only

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=280139&r1=280138&r2=280139&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
Sun Sep 11 06:57:31 2005
@@ -51,7 +51,6 @@
 import org.apache.http.impl.HttpPostRequest;
 import org.apache.http.impl.io.DefaultHttpDataReceiverFactory;
 import org.apache.http.impl.io.DefaultHttpDataTransmitterFactory;
-import org.apache.http.impl.io.NIOSocketFactory;
 import org.apache.http.impl.io.OldIOSocketFactory;
 import org.apache.http.io.SocketFactory;
 import org.apache.http.params.HttpParams;
@@ -145,25 +144,8 @@
 		
 		int port = Integer.parseInt(args[0]);
 		int count = Integer.parseInt(args[1]);
-        boolean useNIO = true;
-        if (args.length >= 3) {
-            String s = args[2];
-            if (s.equalsIgnoreCase("NIO")) {
-                useNIO = true;
-            } else if (s.equalsIgnoreCase("OldIO")) {
-                useNIO = false;
-            } else {
-                System.out.println("Invalid parameter: " + s);
-                System.exit(1);
-            }
-        }
 		
-        SocketFactory socketfactory = null;
-        if (useNIO) {
-        	socketfactory = NIOSocketFactory.getSocketFactory();
-        } else {
-        	socketfactory = OldIOSocketFactory.getSocketFactory();
-        }
+        SocketFactory socketfactory = OldIOSocketFactory.getSocketFactory();
         Protocol http = new Protocol("http", socketfactory, 80);
         HttpHost host = new HttpHost("localhost", port, http);
 
@@ -172,8 +154,8 @@
         Thread.sleep(1000);
         
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection(host);
-        conn.setReceiverFactory(new DefaultHttpDataReceiverFactory(useNIO));
-        conn.setTransmitterFactory(new DefaultHttpDataTransmitterFactory(useNIO));
+        conn.setReceiverFactory(new DefaultHttpDataReceiverFactory());
+        conn.setTransmitterFactory(new DefaultHttpDataTransmitterFactory());
         try {
         	for (int i = 0; i < requests.length; i++) {
         	    test.execute(requests[i], conn, count);



Mime
View raw message