hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r280112 - in /jakarta/httpclient/trunk/http-common/src: java/org/apache/http/impl/io/ test/org/apache/http/impl/ test/tests/performance/
Date Sun, 11 Sep 2005 12:04:55 GMT
Author: olegk
Date: Sun Sep 11 05:04:47 2005
New Revision: 280112

URL: http://svn.apache.org/viewcvs?rev=280112&view=rev
Log:
Constructors of the InputStreamHttpDataReceiver and OutputStreamHttpDataTransmitter classes
made protected

Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/InputStreamHttpDataReceiver.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/OutputStreamHttpDataTransmitter.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
    jakarta/httpclient/trunk/http-common/src/test/tests/performance/ChunkedIOvsContentLengthDelimIOTest.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/InputStreamHttpDataReceiver.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/InputStreamHttpDataReceiver.java?rev=280112&r1=280111&r2=280112&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/InputStreamHttpDataReceiver.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/InputStreamHttpDataReceiver.java
Sun Sep 11 05:04:47 2005
@@ -59,7 +59,7 @@
     
     private String charset = "US-ASCII";
     
-    public InputStreamHttpDataReceiver(final InputStream instream) {
+    protected InputStreamHttpDataReceiver(final InputStream instream) {
         super();
         if (instream == null) {
             throw new IllegalArgumentException("Input stream may not be null");

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/OutputStreamHttpDataTransmitter.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/OutputStreamHttpDataTransmitter.java?rev=280112&r1=280111&r2=280112&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/OutputStreamHttpDataTransmitter.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/io/OutputStreamHttpDataTransmitter.java
Sun Sep 11 05:04:47 2005
@@ -55,7 +55,7 @@
         
     private String charset = "US-ASCII";
     
-    public OutputStreamHttpDataTransmitter(final OutputStream outstream) {
+    protected OutputStreamHttpDataTransmitter(final OutputStream outstream) {
         super();
         if (outstream == null) {
             throw new IllegalArgumentException("Input stream may not be null");

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java?rev=280112&r1=280111&r2=280112&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
Sun Sep 11 05:04:47 2005
@@ -28,21 +28,18 @@
 
 package org.apache.http.impl;
 
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
 import org.apache.http.Header;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpMutableMessage;
 import org.apache.http.ProtocolException;
 import org.apache.http.impl.entity.DefaultEntityGenerator;
 import org.apache.http.impl.entity.EntityGenerator;
-import org.apache.http.impl.io.InputStreamHttpDataReceiver;
 import org.apache.http.io.ChunkedInputStream;
 import org.apache.http.io.ContentLengthInputStream;
 import org.apache.http.io.HttpDataInputStream;
 import org.apache.http.io.HttpDataReceiver;
 import org.apache.http.mockup.HttpDataReceiverMockup;
+import org.apache.http.mockup.InputStreamHttpDataReceiverMockup;
 import org.apache.http.params.HttpProtocolParams;
 
 import junit.framework.Test;
@@ -109,8 +106,8 @@
     }
 
     public void testEntityWithIdentityTransferEncoding() throws Exception {
-        InputStream instream = new ByteArrayInputStream(new byte[] {});
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiver(instream);
+        HttpDataReceiver datareceiver = 
+        	new InputStreamHttpDataReceiverMockup(new byte[] {});
         HttpMutableMessage message = new BasicHttpMessage();
         
         // lenient mode 

Modified: jakarta/httpclient/trunk/http-common/src/test/tests/performance/ChunkedIOvsContentLengthDelimIOTest.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/tests/performance/ChunkedIOvsContentLengthDelimIOTest.java?rev=280112&r1=280111&r2=280112&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/tests/performance/ChunkedIOvsContentLengthDelimIOTest.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/tests/performance/ChunkedIOvsContentLengthDelimIOTest.java
Sun Sep 11 05:04:47 2005
@@ -35,11 +35,13 @@
 import java.util.Random;
 
 import org.apache.http.impl.io.DefaultHttpDataReceiverFactory;
-import org.apache.http.impl.io.OutputStreamHttpDataTransmitter;
+import org.apache.http.impl.io.OldIOSocketHttpDataTransmitter;
 import org.apache.http.io.ChunkedInputStream;
 import org.apache.http.io.ChunkedOutputStream;
 import org.apache.http.io.ContentLengthInputStream;
 import org.apache.http.io.HttpDataReceiverFactory;
+import org.apache.http.io.HttpDataTransmitter;
+import org.apache.http.io.IdentityOutputStream;
 
 public class ChunkedIOvsContentLengthDelimIOTest {
 
@@ -47,7 +49,7 @@
     private static int CONTENT_LEN = 10000000;
 
     private static int PORT = 8082; 
-    private static int RUN_COUNT = 1; 
+    private static int RUN_COUNT = 100; 
     
     public ChunkedIOvsContentLengthDelimIOTest() {
         super();
@@ -93,9 +95,13 @@
             for (int i = 0; i < RUN_COUNT; i++) {
                 Socket conn = new Socket("localhost", PORT);
                 try {
-                    OutputStream out = conn.getOutputStream();
+                	HttpDataTransmitter datatransmitter = 
+                		new OldIOSocketHttpDataTransmitter(conn);
+                    OutputStream out = null;
                     if (chunked) {
-                    	out = new ChunkedOutputStream(new OutputStreamHttpDataTransmitter(out));

+                    	out = new ChunkedOutputStream(datatransmitter); 
+                    } else {
+                    	out = new IdentityOutputStream(datatransmitter); 
                     }
                     int off = 0; 
                     int remaining = data.length;



Mime
View raw message