hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r560358 [1/2] - in /jakarta/httpcomponents/httpcore/trunk/module-main/src: main/java/org/apache/http/impl/ main/java/org/apache/http/impl/entity/ main/java/org/apache/http/impl/io/ test/java/org/apache/http/impl/ test/java/org/apache/http/i...
Date Fri, 27 Jul 2007 19:30:44 GMT
Author: olegk
Date: Fri Jul 27 12:30:42 2007
New Revision: 560358

URL: http://svn.apache.org/viewvc?view=rev&rev=560358
Log:
HTTPCORE-105: Ensure class name consistency in HttpCore base and NIO modules (second pass)

Added:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
      - copied, changed from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataReceiver.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java
      - copied, changed from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/IdentityInputStream.java
      - copied, changed from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/HttpDataInputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketInputBuffer.java
      - copied, changed from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataReceiver.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketOutputBuffer.java
      - copied, changed from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataTransmitter.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestSessionBuffers.java
      - copied, changed from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestHttpDataReceiverAndTransmitter.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentitynputStream.java
      - copied, changed from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestHttpDataInputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java
      - copied, changed from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataReceiverMockup.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java
      - copied, changed from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataTransmitterMockup.java
Removed:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataReceiver.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/HttpDataInputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/HttpDataOutputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataReceiver.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataTransmitter.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestHttpDataReceiverAndTransmitter.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestHttpDataInputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestHttpDataOutputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataReceiverMockup.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataTransmitterMockup.java
Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/entity/EntityDeserializer.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestAllImpl.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestAllIO.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestChunkCoding.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/util/TestHeaderUtils.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java Fri Jul 27 12:30:42 2007
@@ -37,8 +37,8 @@
 import java.net.SocketException;
 
 import org.apache.http.HttpInetConnection;
-import org.apache.http.impl.io.SocketHttpDataReceiver;
-import org.apache.http.impl.io.SocketHttpDataTransmitter;
+import org.apache.http.impl.io.SocketInputBuffer;
+import org.apache.http.impl.io.SocketOutputBuffer;
 import org.apache.http.io.SessionInputBuffer;
 import org.apache.http.io.SessionOutputBuffer;
 import org.apache.http.params.HttpConnectionParams;
@@ -80,14 +80,14 @@
             final Socket socket, 
             int buffersize,
             final HttpParams params) throws IOException {
-        return new SocketHttpDataReceiver(socket, buffersize, params);
+        return new SocketInputBuffer(socket, buffersize, params);
     }
     
     protected SessionOutputBuffer createSessionOutputBuffer(
             final Socket socket, 
             int buffersize,
             final HttpParams params) throws IOException {
-        return new SocketHttpDataTransmitter(socket, buffersize, params);
+        return new SocketOutputBuffer(socket, buffersize, params);
     }
     
     protected void bind(

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java Fri Jul 27 12:30:42 2007
@@ -37,8 +37,8 @@
 import java.net.SocketException;
 
 import org.apache.http.HttpInetConnection;
-import org.apache.http.impl.io.SocketHttpDataReceiver;
-import org.apache.http.impl.io.SocketHttpDataTransmitter;
+import org.apache.http.impl.io.SocketInputBuffer;
+import org.apache.http.impl.io.SocketOutputBuffer;
 import org.apache.http.io.SessionInputBuffer;
 import org.apache.http.io.SessionOutputBuffer;
 import org.apache.http.params.HttpConnectionParams;
@@ -80,14 +80,14 @@
             final Socket socket, 
             int buffersize,
             final HttpParams params) throws IOException {
-        return new SocketHttpDataReceiver(socket, buffersize, params);
+        return new SocketInputBuffer(socket, buffersize, params);
     }
     
     protected SessionOutputBuffer createHttpDataTransmitter(
             final Socket socket, 
             int buffersize,
             final HttpParams params) throws IOException {
-        return new SocketHttpDataTransmitter(socket, buffersize, params);
+        return new SocketOutputBuffer(socket, buffersize, params);
     }
     
     protected void bind(final Socket socket, final HttpParams params) throws IOException {

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/entity/EntityDeserializer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/entity/EntityDeserializer.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/entity/EntityDeserializer.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/entity/EntityDeserializer.java Fri Jul 27 12:30:42 2007
@@ -41,7 +41,7 @@
 import org.apache.http.entity.ContentLengthStrategy;
 import org.apache.http.impl.io.ChunkedInputStream;
 import org.apache.http.impl.io.ContentLengthInputStream;
-import org.apache.http.impl.io.HttpDataInputStream;
+import org.apache.http.impl.io.IdentityInputStream;
 import org.apache.http.io.SessionInputBuffer;
 import org.apache.http.protocol.HTTP;
 
@@ -82,7 +82,7 @@
         } else if (len == ContentLengthStrategy.IDENTITY) {
             entity.setChunked(false);
             entity.setContentLength(-1);
-            entity.setContent(new HttpDataInputStream(inbuffer));                            
+            entity.setContent(new IdentityInputStream(inbuffer));                            
         } else {
             entity.setChunked(false);
             entity.setContentLength(len);

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java (from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataReceiver.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataReceiver.java&r1=560343&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataReceiver.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java Fri Jul 27 12:30:42 2007
@@ -44,12 +44,13 @@
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- * Abstract base class for data receivers using traditional IO.
+ * Abstract base class for session input buffers that stream data 
+ * from a {@link InputStream}.
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  *
  */
-public abstract class AbstractHttpDataReceiver implements SessionInputBuffer {
+public abstract class AbstractSessionInputBuffer implements SessionInputBuffer {
 
     private InputStream instream;
     private byte[] buffer;

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java (from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java&r1=560343&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java Fri Jul 27 12:30:42 2007
@@ -43,12 +43,13 @@
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- * Abstract base class for data transmitters using traditional IO.
+ * Abstract base class for session output buffers that stream data
+ * to an {@link OutputStream}. 
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  *
  */
-public abstract class AbstractHttpDataTransmitter implements SessionOutputBuffer {
+public abstract class AbstractSessionOutputBuffer implements SessionOutputBuffer {
 
     private static final byte[] CRLF = new byte[] {HTTP.CR, HTTP.LF};
     

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/IdentityInputStream.java (from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/HttpDataInputStream.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/IdentityInputStream.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/HttpDataInputStream.java&r1=560343&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/IdentityInputStream.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/HttpDataInputStream.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/IdentityInputStream.java Fri Jul 27 12:30:42 2007
@@ -45,13 +45,13 @@
  * 
  * @since 4.0
  */
-public class HttpDataInputStream extends InputStream {
+public class IdentityInputStream extends InputStream {
     
     private final SessionInputBuffer in;
     
     private boolean closed = false;
     
-    public HttpDataInputStream(final SessionInputBuffer in) {
+    public IdentityInputStream(final SessionInputBuffer in) {
         super();
         if (in == null) {
             throw new IllegalArgumentException("Session input buffer may not be null");

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketInputBuffer.java (from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataReceiver.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketInputBuffer.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataReceiver.java&r1=560341&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketInputBuffer.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataReceiver.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketInputBuffer.java Fri Jul 27 12:30:42 2007
@@ -39,7 +39,7 @@
 
 
 /**
- * A data receiver using a Java {@link Socket} and traditional IO.
+ * {@link Socket} bound session input buffer.
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  *
@@ -47,7 +47,7 @@
  * 
  * @since 4.0
  */
-public class SocketHttpDataReceiver extends AbstractHttpDataReceiver {
+public class SocketInputBuffer extends AbstractSessionInputBuffer {
 
     static private final Class SOCKET_TIMEOUT_CLASS = SocketTimeoutExceptionClass();
 
@@ -75,7 +75,7 @@
     
     private final Socket socket;
     
-    public SocketHttpDataReceiver(
+    public SocketInputBuffer(
             final Socket socket, 
             int buffersize, 
             final HttpParams params) throws IOException {

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketOutputBuffer.java (from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataTransmitter.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketOutputBuffer.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataTransmitter.java&r1=560341&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketOutputBuffer.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketHttpDataTransmitter.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SocketOutputBuffer.java Fri Jul 27 12:30:42 2007
@@ -38,7 +38,7 @@
 
 
 /**
- * A data transmitter using a Java {@link Socket} and traditional IO.
+ * {@link Socket} bound session output buffer.
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  *
@@ -46,9 +46,9 @@
  * 
  * @since 4.0
  */
-public class SocketHttpDataTransmitter extends AbstractHttpDataTransmitter {
+public class SocketOutputBuffer extends AbstractSessionOutputBuffer {
 
-    public SocketHttpDataTransmitter(
+    public SocketOutputBuffer(
             final Socket socket, 
             int buffersize,
             final HttpParams params) throws IOException {

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestAllImpl.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestAllImpl.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestAllImpl.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestAllImpl.java Fri Jul 27 12:30:42 2007
@@ -40,7 +40,7 @@
 
     public static Test suite() {
         TestSuite suite = new TestSuite();
-        suite.addTest(TestHttpDataReceiverAndTransmitter.suite());
+        suite.addTest(TestSessionBuffers.suite());
         suite.addTest(TestDefaultConnectionReuseStrategy.suite());
         suite.addTest(TestEnglishReasonPhraseCatalog.suite());
         suite.addTest(TestBasicRequest.suite());

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestSessionBuffers.java (from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestHttpDataReceiverAndTransmitter.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestSessionBuffers.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestHttpDataReceiverAndTransmitter.java&r1=560341&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestSessionBuffers.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestHttpDataReceiverAndTransmitter.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/TestSessionBuffers.java Fri Jul 27 12:30:42 2007
@@ -41,57 +41,57 @@
 import org.apache.http.io.HttpTransportMetrics;
 
 import org.apache.http.params.BasicHttpParams;
-import org.apache.http.mockup.HttpDataReceiverMockup;
-import org.apache.http.mockup.HttpDataTransmitterMockup;
+import org.apache.http.mockup.SessionInputBufferMockup;
+import org.apache.http.mockup.SessionOutputBufferMockup;
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.CharArrayBuffer;
 
-public class TestHttpDataReceiverAndTransmitter extends TestCase {
+public class TestSessionBuffers extends TestCase {
 
-    public TestHttpDataReceiverAndTransmitter(String testName) {
+    public TestSessionBuffers(String testName) {
         super(testName);
     }
 
     // ------------------------------------------------------- TestCase Methods
 
     public static Test suite() {
-        return new TestSuite(TestHttpDataReceiverAndTransmitter.class);
+        return new TestSuite(TestSessionBuffers.class);
     }
 
     // ------------------------------------------------------------------- Main
     public static void main(String args[]) {
-        String[] testCaseName = { TestHttpDataReceiverAndTransmitter.class.getName() };
+        String[] testCaseName = { TestSessionBuffers.class.getName() };
         junit.textui.TestRunner.main(testCaseName);
     }
 
     public void testInit() throws Exception {
         ByteArrayOutputStream out = new ByteArrayOutputStream();
-        new HttpDataTransmitterMockup(out); 
+        new SessionOutputBufferMockup(out); 
         try {
-            new HttpDataTransmitterMockup(null, new BasicHttpParams()); 
+            new SessionOutputBufferMockup(null, new BasicHttpParams()); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
         }
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-        new HttpDataReceiverMockup(in, 10); 
+        new SessionInputBufferMockup(in, 10); 
         try {
-            new HttpDataReceiverMockup(in, -10); 
+            new SessionInputBufferMockup(in, -10); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
         }
         try {
-            new HttpDataTransmitterMockup(out, -10); 
+            new SessionOutputBufferMockup(out, -10); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
         }
         try {
-            new HttpDataReceiverMockup((InputStream)null, 1024); 
+            new SessionInputBufferMockup((InputStream)null, 1024); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
@@ -114,18 +114,18 @@
         teststrs[4] = "And goodbye";
         
         CharArrayBuffer chbuffer = new CharArrayBuffer(16); 
-        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup(); 
+        SessionOutputBufferMockup outbuffer = new SessionOutputBufferMockup(); 
         for (int i = 0; i < teststrs.length; i++) {
             chbuffer.clear();
             chbuffer.append(teststrs[i]);
-            transmitter.writeLine(chbuffer);
+            outbuffer.writeLine(chbuffer);
         }
         //these write operations should have no effect
-        transmitter.writeLine((String)null);
-        transmitter.writeLine((CharArrayBuffer)null);
-        transmitter.flush();
+        outbuffer.writeLine((String)null);
+        outbuffer.writeLine((CharArrayBuffer)null);
+        outbuffer.flush();
         
-        HttpTransportMetrics tmetrics = transmitter.getMetrics();
+        HttpTransportMetrics tmetrics = outbuffer.getMetrics();
         long writedBytes = tmetrics.getBytesTransferred();
         long expWrited = 0;
         for (int i = 0; i < teststrs.length; i++) {
@@ -133,33 +133,33 @@
         }
         assertEquals(expWrited, writedBytes);
         
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(
-        		transmitter.getData());
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(
+        		outbuffer.getData());
 
         for (int i = 0; i < teststrs.length; i++) {
-            assertEquals(teststrs[i], receiver.readLine());
+            assertEquals(teststrs[i], inbuffer.readLine());
         }
         
-        assertNull(receiver.readLine());
-        assertNull(receiver.readLine());
-        tmetrics = receiver.getMetrics();
+        assertNull(inbuffer.readLine());
+        assertNull(inbuffer.readLine());
+        tmetrics = inbuffer.getMetrics();
         long readedBytes = tmetrics.getBytesTransferred();
         assertEquals(expWrited, readedBytes);
     }
 
     public void testComplexReadWriteLine() throws Exception {
-        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup(); 
-        transmitter.write(new byte[] {'a', '\n'});
-        transmitter.write(new byte[] {'\r', '\n'});
-        transmitter.write(new byte[] {'\r', '\r', '\n'});
-        transmitter.write(new byte[] {'\n'});
+        SessionOutputBufferMockup outbuffer = new SessionOutputBufferMockup(); 
+        outbuffer.write(new byte[] {'a', '\n'});
+        outbuffer.write(new byte[] {'\r', '\n'});
+        outbuffer.write(new byte[] {'\r', '\r', '\n'});
+        outbuffer.write(new byte[] {'\n'});
         //these write operations should have no effect
-        transmitter.write(null);
-        transmitter.write(null, 0, 12);
+        outbuffer.write(null);
+        outbuffer.write(null, 0, 12);
         
-        transmitter.flush();
+        outbuffer.flush();
 
-        long writedBytes = transmitter.getMetrics().getBytesTransferred();
+        long writedBytes = outbuffer.getMetrics().getBytesTransferred();
         assertEquals(8, writedBytes);
         
         StringBuffer buffer = new StringBuffer();
@@ -168,9 +168,9 @@
         }
         String s1 = buffer.toString();
         buffer.append("\r\n");
-        transmitter.write(buffer.toString().getBytes("US-ASCII"));
-        transmitter.flush();
-        writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.write(buffer.toString().getBytes("US-ASCII"));
+        outbuffer.flush();
+        writedBytes = outbuffer.getMetrics().getBytesTransferred();
         assertEquals(8 + 14 +2, writedBytes);
 
         buffer.setLength(0);
@@ -179,9 +179,9 @@
         }
         String s2 = buffer.toString();
         buffer.append("\r\n");
-        transmitter.write(buffer.toString().getBytes("US-ASCII"));
-        transmitter.flush();
-        writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.write(buffer.toString().getBytes("US-ASCII"));
+        outbuffer.flush();
+        writedBytes = outbuffer.getMetrics().getBytesTransferred();
         assertEquals(8 + 14 + 2 + 15 + 2 , writedBytes);
 
         buffer.setLength(0);
@@ -190,30 +190,30 @@
         }
         String s3 = buffer.toString();
         buffer.append("\r\n");
-        transmitter.write(buffer.toString().getBytes("US-ASCII"));
-        transmitter.flush();
-        writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.write(buffer.toString().getBytes("US-ASCII"));
+        outbuffer.flush();
+        writedBytes = outbuffer.getMetrics().getBytesTransferred();
         assertEquals(8 + 14 + 2 + 15 + 2 + 16 + 2, writedBytes);
 
-        transmitter.write(new byte[] {'a'});
-        transmitter.flush();
-        writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.write(new byte[] {'a'});
+        outbuffer.flush();
+        writedBytes = outbuffer.getMetrics().getBytesTransferred();
         assertEquals(8 + 14 + 2 + 15 + 2 + 16 + 2 + 1, writedBytes);
         
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(
-        		transmitter.getData());
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(
+        		outbuffer.getData());
 
-        assertEquals("a", receiver.readLine());
-        assertEquals("", receiver.readLine());
-        assertEquals("\r", receiver.readLine());
-        assertEquals("", receiver.readLine());
-        assertEquals(s1, receiver.readLine());
-        assertEquals(s2, receiver.readLine());
-        assertEquals(s3, receiver.readLine());
-        assertEquals("a", receiver.readLine());
-        assertNull(receiver.readLine());
-        assertNull(receiver.readLine());
-        long received = receiver.getMetrics().getBytesTransferred();
+        assertEquals("a", inbuffer.readLine());
+        assertEquals("", inbuffer.readLine());
+        assertEquals("\r", inbuffer.readLine());
+        assertEquals("", inbuffer.readLine());
+        assertEquals(s1, inbuffer.readLine());
+        assertEquals(s2, inbuffer.readLine());
+        assertEquals(s3, inbuffer.readLine());
+        assertEquals("a", inbuffer.readLine());
+        assertNull(inbuffer.readLine());
+        assertNull(inbuffer.readLine());
+        long received = inbuffer.getMetrics().getBytesTransferred();
         assertEquals(writedBytes, received);
     }
     
@@ -233,43 +233,43 @@
         teststrs[4] = "And goodbye";
         
         CharArrayBuffer chbuffer = new CharArrayBuffer(16); 
-        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup(); 
+        SessionOutputBufferMockup outbuffer = new SessionOutputBufferMockup(); 
         for (int i = 0; i < teststrs.length; i++) {
             chbuffer.clear();
             chbuffer.append(teststrs[i]);
-            transmitter.writeLine(chbuffer);
+            outbuffer.writeLine(chbuffer);
         }
         //these write operations should have no effect
-        transmitter.writeLine((String)null);
-        transmitter.writeLine((CharArrayBuffer)null);
-        transmitter.flush();
+        outbuffer.writeLine((String)null);
+        outbuffer.writeLine((CharArrayBuffer)null);
+        outbuffer.flush();
         
-        long writedBytes = transmitter.getMetrics().getBytesTransferred();
+        long writedBytes = outbuffer.getMetrics().getBytesTransferred();
         long expWrited = 0;
         for (int i = 0; i < teststrs.length; i++) {
             expWrited += (teststrs[i].length() + 2/*CRLF*/);
         }
         assertEquals(expWrited, writedBytes);
         
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(
-        		transmitter.getData(), 1024);
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(
+        		outbuffer.getData(), 1024);
 
         for (int i = 0; i < teststrs.length; i++) {
-            assertEquals(teststrs[i], receiver.readLine());
+            assertEquals(teststrs[i], inbuffer.readLine());
         }
-        assertNull(receiver.readLine());
-        assertNull(receiver.readLine());
-        long readedBytes = receiver.getMetrics().getBytesTransferred();
+        assertNull(inbuffer.readLine());
+        assertNull(inbuffer.readLine());
+        long readedBytes = inbuffer.getMetrics().getBytesTransferred();
         assertEquals(expWrited, readedBytes);
     }
 
     public void testReadWriteBytes() throws Exception {
-        // make the buffer larger than that of transmitter
+        // make the buffer larger than that of outbuffer
         byte[] out = new byte[40];
         for (int i = 0; i < out.length; i++) {
             out[i] = (byte)('0' + i);
         }
-        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup();
+        SessionOutputBufferMockup outbuffer = new SessionOutputBufferMockup();
         int off = 0;
         int remaining = out.length;
         while (remaining > 0) {
@@ -277,26 +277,26 @@
             if (chunk > remaining) {
                 chunk = remaining;
             }
-            transmitter.write(out, off, chunk);
+            outbuffer.write(out, off, chunk);
             off += chunk;
             remaining -= chunk;
         }
-        transmitter.flush();
-        long writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.flush();
+        long writedBytes = outbuffer.getMetrics().getBytesTransferred();
         assertEquals(out.length, writedBytes);
 
-        byte[] tmp = transmitter.getData();
+        byte[] tmp = outbuffer.getData();
         assertEquals(out.length, tmp.length);
         for (int i = 0; i < out.length; i++) {
             assertEquals(out[i], tmp[i]);
         }
         
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(tmp);
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(tmp);
 
         // these read operations will have no effect
-        assertEquals(0, receiver.read(null, 0, 10));
-        assertEquals(0, receiver.read(null));        
-        long receivedBytes = receiver.getMetrics().getBytesTransferred();
+        assertEquals(0, inbuffer.read(null, 0, 10));
+        assertEquals(0, inbuffer.read(null));        
+        long receivedBytes = inbuffer.getMetrics().getBytesTransferred();
         assertEquals(0, receivedBytes);
         
         byte[] in = new byte[40];
@@ -307,7 +307,7 @@
             if (chunk > remaining) {
                 chunk = remaining;
             }
-            int l = receiver.read(in, off, chunk);
+            int l = inbuffer.read(in, off, chunk);
             if (l == -1) {
                 break;
             }
@@ -317,43 +317,43 @@
         for (int i = 0; i < out.length; i++) {
             assertEquals(out[i], in[i]);
         }
-        assertEquals(-1, receiver.read(tmp));
-        assertEquals(-1, receiver.read(tmp));
-        receivedBytes = receiver.getMetrics().getBytesTransferred();
+        assertEquals(-1, inbuffer.read(tmp));
+        assertEquals(-1, inbuffer.read(tmp));
+        receivedBytes = inbuffer.getMetrics().getBytesTransferred();
         assertEquals(out.length, receivedBytes);
     }
     
     public void testReadWriteByte() throws Exception {
-        // make the buffer larger than that of transmitter
+        // make the buffer larger than that of outbuffer
         byte[] out = new byte[40];
         for (int i = 0; i < out.length; i++) {
             out[i] = (byte)(120 + i);
         }
-        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup();
+        SessionOutputBufferMockup outbuffer = new SessionOutputBufferMockup();
         for (int i = 0; i < out.length; i++) {
-            transmitter.write(out[i]);
+            outbuffer.write(out[i]);
         }
-        transmitter.flush();
-        long writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.flush();
+        long writedBytes = outbuffer.getMetrics().getBytesTransferred();
         assertEquals(out.length, writedBytes);
 
-        byte[] tmp = transmitter.getData();
+        byte[] tmp = outbuffer.getData();
         assertEquals(out.length, tmp.length);
         for (int i = 0; i < out.length; i++) {
             assertEquals(out[i], tmp[i]);
         }
         
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(tmp);
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(tmp);
         byte[] in = new byte[40];
         for (int i = 0; i < in.length; i++) {
-            in[i] = (byte)receiver.read();
+            in[i] = (byte)inbuffer.read();
         }
         for (int i = 0; i < out.length; i++) {
             assertEquals(out[i], in[i]);
         }
-        assertEquals(-1, receiver.read());
-        assertEquals(-1, receiver.read());
-        long readedBytes = receiver.getMetrics().getBytesTransferred();
+        assertEquals(-1, inbuffer.read());
+        assertEquals(-1, inbuffer.read());
+        long readedBytes = inbuffer.getMetrics().getBytesTransferred();
         assertEquals(out.length, readedBytes);
     }
 
@@ -363,20 +363,20 @@
         byte[] tmp = s.getBytes("US-ASCII"); 
         // no limit
         params.setIntParameter(HttpConnectionParams.MAX_LINE_LENGTH, 0);
-        HttpDataReceiverMockup receiver1 = new HttpDataReceiverMockup(tmp, 5, params);
-        assertNotNull(receiver1.readLine());
-        long readedBytes = receiver1.getMetrics().getBytesTransferred();
+        SessionInputBufferMockup inbuffer1 = new SessionInputBufferMockup(tmp, 5, params);
+        assertNotNull(inbuffer1.readLine());
+        long readedBytes = inbuffer1.getMetrics().getBytesTransferred();
         assertEquals(60, readedBytes);
         
         // 15 char limit
         params.setIntParameter(HttpConnectionParams.MAX_LINE_LENGTH, 15);
-        HttpDataReceiverMockup receiver2 = new HttpDataReceiverMockup(tmp, 5, params);
+        SessionInputBufferMockup inbuffer2 = new SessionInputBufferMockup(tmp, 5, params);
         try {
-            receiver2.readLine();
+            inbuffer2.readLine();
             fail("IOException should have been thrown");
         } catch (IOException ex) {
             // expected
-            readedBytes = receiver2.getMetrics().getBytesTransferred();
+            readedBytes = inbuffer2.getMetrics().getBytesTransferred();
             assertEquals(20, readedBytes);
         }
     }
@@ -408,38 +408,38 @@
         HttpParams params = new BasicHttpParams(null);
         HttpProtocolParams.setHttpElementCharset(params, "UTF-8");
         
-        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup(params);
+        SessionOutputBufferMockup outbuffer = new SessionOutputBufferMockup(params);
 
         CharArrayBuffer chbuffer = new CharArrayBuffer(16); 
         for (int i = 0; i < 10; i++) {
             chbuffer.clear();
             chbuffer.append(s1);
-            transmitter.writeLine(chbuffer);
+            outbuffer.writeLine(chbuffer);
             chbuffer.clear();
             chbuffer.append(s2);
-            transmitter.writeLine(chbuffer);
+            outbuffer.writeLine(chbuffer);
             chbuffer.clear();
             chbuffer.append(s3);
-            transmitter.writeLine(chbuffer);
+            outbuffer.writeLine(chbuffer);
         }
-        transmitter.flush();
-        long writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.flush();
+        long writedBytes = outbuffer.getMetrics().getBytesTransferred();
         long expBytes = ((s1.toString().getBytes("UTF-8").length + 2)+
                 (s2.toString().getBytes("UTF-8").length + 2) +
                 (s3.toString().getBytes("UTF-8").length + 2)) * 10;
         assertEquals(expBytes, writedBytes);
         
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(
-        		transmitter.getData(), params);
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(
+        		outbuffer.getData(), params);
 
         for (int i = 0; i < 10; i++) {
-            assertEquals(s1, receiver.readLine());
-            assertEquals(s2, receiver.readLine());
-            assertEquals(s3, receiver.readLine());
-        }
-        assertNull(receiver.readLine());
-        assertNull(receiver.readLine());
-        long readedBytes = receiver.getMetrics().getBytesTransferred();
+            assertEquals(s1, inbuffer.readLine());
+            assertEquals(s2, inbuffer.readLine());
+            assertEquals(s3, inbuffer.readLine());
+        }
+        assertNull(inbuffer.readLine());
+        assertNull(inbuffer.readLine());
+        long readedBytes = inbuffer.getMetrics().getBytesTransferred();
         assertEquals(expBytes, readedBytes);
     }
 
@@ -449,41 +449,41 @@
         HttpParams params = new BasicHttpParams(null);
         HttpProtocolParams.setHttpElementCharset(params, HTTP.ISO_8859_1);
         
-        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup(params);
+        SessionOutputBufferMockup outbuffer = new SessionOutputBufferMockup(params);
 
         CharArrayBuffer chbuffer = new CharArrayBuffer(16); 
         for (int i = 0; i < 10; i++) {
             chbuffer.clear();
             chbuffer.append(s1);
-            transmitter.writeLine(chbuffer);
+            outbuffer.writeLine(chbuffer);
         }
-        transmitter.flush();
-        long writedBytes = transmitter.getMetrics().getBytesTransferred();
+        outbuffer.flush();
+        long writedBytes = outbuffer.getMetrics().getBytesTransferred();
         long expBytes = ((s1.toString().getBytes(HTTP.ISO_8859_1).length + 2)) * 10;
         assertEquals(expBytes, writedBytes);
         
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(
-                transmitter.getData(),
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(
+                outbuffer.getData(),
                 params);
         HttpProtocolParams.setHttpElementCharset(params, HTTP.ISO_8859_1);
 
         for (int i = 0; i < 10; i++) {
-            assertEquals(s1, receiver.readLine());
+            assertEquals(s1, inbuffer.readLine());
         }
-        assertNull(receiver.readLine());
-        assertNull(receiver.readLine());
-        long readedBytes = receiver.getMetrics().getBytesTransferred();
+        assertNull(inbuffer.readLine());
+        assertNull(inbuffer.readLine());
+        long readedBytes = inbuffer.getMetrics().getBytesTransferred();
         assertEquals(expBytes, readedBytes);
     }
 
     public void testInvalidCharArrayBuffer() throws Exception {
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(new byte[] {});
+        SessionInputBufferMockup inbuffer = new SessionInputBufferMockup(new byte[] {});
         try {
-            receiver.readLine(null); 
+            inbuffer.readLine(null); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
-            long readedBytes = receiver.getMetrics().getBytesTransferred();
+            long readedBytes = inbuffer.getMetrics().getBytesTransferred();
             assertEquals(0, readedBytes);
         }
     }

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java Fri Jul 27 12:30:42 2007
@@ -41,9 +41,9 @@
 import org.apache.http.ProtocolException;
 import org.apache.http.impl.io.ChunkedInputStream;
 import org.apache.http.impl.io.ContentLengthInputStream;
-import org.apache.http.impl.io.HttpDataInputStream;
+import org.apache.http.impl.io.IdentityInputStream;
 import org.apache.http.io.SessionInputBuffer;
-import org.apache.http.mockup.HttpDataReceiverMockup;
+import org.apache.http.mockup.SessionInputBufferMockup;
 import org.apache.http.mockup.HttpMessageMockup;
 import org.apache.http.params.HttpProtocolParams;
 
@@ -75,7 +75,7 @@
             // expected
         }
         try {
-            entitygen.deserialize(new HttpDataReceiverMockup(new byte[] {}) , null);
+            entitygen.deserialize(new SessionInputBufferMockup(new byte[] {}) , null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -83,7 +83,7 @@
     }
 
     public void testEntityWithTransferEncoding() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup("0\r\n", "US-ASCII");
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup("0\r\n", "US-ASCII");
         HttpMessage message = new HttpMessageMockup();
         
         // lenient mode 
@@ -110,7 +110,7 @@
 
     public void testEntityWithIdentityTransferEncoding() throws Exception {
         SessionInputBuffer datareceiver = 
-        	new HttpDataReceiverMockup(new byte[] {});
+        	new SessionInputBufferMockup(new byte[] {});
         HttpMessage message = new HttpMessageMockup();
         
         // lenient mode 
@@ -127,7 +127,7 @@
     }
 
     public void testEntityWithUnsupportedTransferEncoding() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup("0\r\n", "US-ASCII");
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup("0\r\n", "US-ASCII");
         HttpMessage message = new HttpMessageMockup();
         
         // lenient mode 
@@ -154,7 +154,7 @@
     }
 
     public void testChunkedTransferEncodingMustBeLast() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup("0\r\n", "US-ASCII");
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup("0\r\n", "US-ASCII");
         HttpMessage message = new HttpMessageMockup();
         
         // lenient mode 
@@ -181,7 +181,7 @@
     }
 
     public void testEntityWithContentLength() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {});
         HttpMessage message = new HttpMessageMockup();
         
         // lenient mode 
@@ -198,7 +198,7 @@
     }
 
     public void testEntityWithMultipleContentLength() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
         // lenient mode 
@@ -228,7 +228,7 @@
     }
     
     public void testEntityWithMultipleContentLengthSomeWrong() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
         // lenient mode 
@@ -258,7 +258,7 @@
     }
     
     public void testEntityWithMultipleContentLengthAllWrong() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
         // lenient mode 
@@ -275,7 +275,7 @@
         InputStream instream = entity.getContent();
         assertNotNull(instream);
         assertFalse(instream instanceof ContentLengthInputStream);
-        assertTrue(instream instanceof HttpDataInputStream);
+        assertTrue(instream instanceof IdentityInputStream);
         
         // strict mode 
         message.getParams().setBooleanParameter(HttpProtocolParams.STRICT_TRANSFER_ENCODING, true);
@@ -288,7 +288,7 @@
     }
 
     public void testEntityWithInvalidContentLength() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
         // lenient mode 
@@ -304,7 +304,7 @@
         InputStream instream = entity.getContent();
         assertNotNull(instream);
         assertFalse(instream instanceof ContentLengthInputStream);
-        assertTrue(instream instanceof HttpDataInputStream);
+        assertTrue(instream instanceof IdentityInputStream);
         
         // strict mode 
         message.getParams().setBooleanParameter(HttpProtocolParams.STRICT_TRANSFER_ENCODING, true);
@@ -317,7 +317,7 @@
     }
 
     public void testEntityNeitherContentLengthNorTransferEncoding() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
         // lenient mode 
@@ -332,11 +332,11 @@
         assertNotNull(instream);
         assertFalse(instream instanceof ContentLengthInputStream);
         assertFalse(instream instanceof ChunkedInputStream);
-        assertTrue(instream instanceof HttpDataInputStream);
+        assertTrue(instream instanceof IdentityInputStream);
     }
 
     public void testEntityContentType() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
         message.addHeader("Content-Type", "stuff");
@@ -349,7 +349,7 @@
     }
 
     public void testEntityContentEncoding() throws Exception {
-        SessionInputBuffer datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
         message.addHeader("Content-Encoding", "what not");

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java Fri Jul 27 12:30:42 2007
@@ -44,7 +44,7 @@
 import org.apache.http.impl.io.ContentLengthOutputStream;
 import org.apache.http.impl.io.IdentityOutputStream;
 import org.apache.http.io.SessionOutputBuffer;
-import org.apache.http.mockup.HttpDataTransmitterMockup;
+import org.apache.http.mockup.SessionOutputBufferMockup;
 import org.apache.http.mockup.HttpMessageMockup;
 import org.apache.http.params.HttpProtocolParams;
 
@@ -76,13 +76,13 @@
             // expected
         }
         try {
-            entitywriter.serialize(new HttpDataTransmitterMockup() , null, null);
+            entitywriter.serialize(new SessionOutputBufferMockup() , null, null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            entitywriter.serialize(new HttpDataTransmitterMockup() , new HttpMessageMockup(), null);
+            entitywriter.serialize(new SessionOutputBufferMockup() , new HttpMessageMockup(), null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -90,7 +90,7 @@
     }
 
     public void testEntityWithChunkTransferEncoding() throws Exception {
-        SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Transfer-Encoding", "Chunked");
 
@@ -102,7 +102,7 @@
     }
 
     public void testEntityWithIdentityTransferEncoding() throws Exception {
-        SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Transfer-Encoding", "Identity");
 
@@ -114,7 +114,7 @@
     }
     
     public void testEntityWithInvalidTransferEncoding() throws Exception {
-        SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Transfer-Encoding", "whatever");
 
@@ -129,7 +129,7 @@
     }
     
     public void testEntityWithInvalidChunkEncodingAndHTTP10() throws Exception {
-        SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.getParams().setParameter(HttpProtocolParams.PROTOCOL_VERSION, 
                 HttpVersion.HTTP_1_0);
@@ -146,7 +146,7 @@
     }
     
     public void testEntityWithContentLength() throws Exception {
-        SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Content-Length", "100");
         EntitySerializer entitywriter = new EntitySerializer(
@@ -157,7 +157,7 @@
     }
     
     public void testEntityWithInvalidContentLength() throws Exception {
-        SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Content-Length", "whatever");
 
@@ -172,7 +172,7 @@
     }
 
     public void testEntityNoContentDelimiter() throws Exception {
-        SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         EntitySerializer entitywriter = new EntitySerializer(
                 new StrictContentLengthStrategy());
@@ -185,7 +185,7 @@
         byte[] content = new byte[] {1, 2, 3, 4, 5};
         ByteArrayEntity entity = new ByteArrayEntity(content); 
         
-        HttpDataTransmitterMockup datatransmitter = new HttpDataTransmitterMockup();
+        SessionOutputBufferMockup datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Content-Length", Integer.toString(content.length));
         

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestAllIO.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestAllIO.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestAllIO.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestAllIO.java Fri Jul 27 12:30:42 2007
@@ -40,11 +40,10 @@
 
     public static Test suite() {
         TestSuite suite = new TestSuite();
-        suite.addTest(TestHttpDataInputStream.suite());
-        suite.addTest(TestHttpDataOutputStream.suite());
         suite.addTest(TestChunkCoding.suite());
         suite.addTest(TestContentLengthInputStream.suite());
         suite.addTest(TestContentLengthOutputStream.suite());
+        suite.addTest(TestIdentitynputStream.suite());
         suite.addTest(TestIdentityOutputStream.suite());
         return suite;
     }

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestChunkCoding.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestChunkCoding.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestChunkCoding.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestChunkCoding.java Fri Jul 27 12:30:42 2007
@@ -40,8 +40,8 @@
 import org.apache.http.impl.io.ChunkedInputStream;
 import org.apache.http.impl.io.ChunkedOutputStream;
 import org.apache.http.io.SessionInputBuffer;
-import org.apache.http.mockup.HttpDataReceiverMockup;
-import org.apache.http.mockup.HttpDataTransmitterMockup;
+import org.apache.http.mockup.SessionInputBufferMockup;
+import org.apache.http.mockup.SessionOutputBufferMockup;
 import org.apache.http.util.EncodingUtils;
 
 import junit.framework.Test;
@@ -88,7 +88,7 @@
     // Test for when buffer is larger than chunk size
     public void testChunkedInputStreamLargeBuffer() throws IOException {
         ChunkedInputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(CHUNKED_INPUT, CONTENT_CHARSET)));
         byte[] buffer = new byte[300];
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -116,7 +116,7 @@
     //Test for when buffer is smaller than chunk size.
     public void testChunkedInputStreamSmallBuffer() throws IOException {
         ChunkedInputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                             EncodingUtils.getBytes(CHUNKED_INPUT, CONTENT_CHARSET)));
 
         byte[] buffer = new byte[7];
@@ -144,7 +144,7 @@
     public void testChunkedInputStreamOneByteRead() throws IOException {
         String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         ChunkedInputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(s, CONTENT_CHARSET)));
         int ch;
         int i = '0';
@@ -161,7 +161,7 @@
     public void testChunkedInputStreamClose() throws IOException {
         String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         ChunkedInputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(s, CONTENT_CHARSET)));
         in.close();
         in.close();
@@ -188,7 +188,7 @@
 
     public void testChunkedOutputStreamClose() throws IOException {
         ChunkedOutputStream out = new ChunkedOutputStream(
-                new HttpDataTransmitterMockup());
+                new SessionOutputBufferMockup());
         out.close();
         out.close();
         try {
@@ -209,7 +209,7 @@
     public void testCorruptChunkedInputStreamMissingCRLF() throws IOException {
         String s = "5\r\n012345\r\n56789\r\n0\r\n";
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(s, CONTENT_CHARSET)));
         byte[] buffer = new byte[300];
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -228,7 +228,7 @@
     public void testCorruptChunkedInputStreamMissingLF() throws IOException {
         String s = "5\r01234\r\n5\r\n56789\r\n0\r\n";
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(s, CONTENT_CHARSET)));
         try {
             in.read();
@@ -241,7 +241,7 @@
     // Missing closing chunk
     public void testCorruptChunkedInputStreamNoClosingChunk() throws IOException {
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(new byte[] {}));
+                new SessionInputBufferMockup(new byte[] {}));
         try {
             in.read();
             fail("MalformedChunkCodingException should have been thrown");
@@ -254,7 +254,7 @@
     public void testCorruptChunkedInputStreamInvalidSize() throws IOException {
         String s = "whatever\r\n01234\r\n5\r\n56789\r\n0\r\n";
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(s, CONTENT_CHARSET)));
         try {
             in.read();
@@ -268,7 +268,7 @@
     public void testCorruptChunkedInputStreamNegativeSize() throws IOException {
         String s = "-5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(s, CONTENT_CHARSET)));
         try {
             in.read();
@@ -282,7 +282,7 @@
     public void testCorruptChunkedInputStreamInvalidFooter() throws IOException {
         String s = "1\r\n0\r\n0\r\nstuff\r\n";
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(s, CONTENT_CHARSET)));
         try {
             in.read();
@@ -296,7 +296,7 @@
     public void testEmptyChunkedInputStream() throws IOException {
         String input = "0\r\n";
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         EncodingUtils.getBytes(input, CONTENT_CHARSET)));
         byte[] buffer = new byte[300];
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -310,14 +310,14 @@
     public void testChunkedConsitance() throws IOException {
         String input = "76126;27823abcd;:q38a-\nkjc\rk%1ad\tkh/asdui\r\njkh+?\\suweb";
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-        OutputStream out = new ChunkedOutputStream(new HttpDataTransmitterMockup(buffer));
+        OutputStream out = new ChunkedOutputStream(new SessionOutputBufferMockup(buffer));
         out.write(EncodingUtils.getBytes(input, CONTENT_CHARSET));
         out.flush();
         out.close();
         out.close();
         buffer.close();
         InputStream in = new ChunkedInputStream(
-                new HttpDataReceiverMockup(
+                new SessionInputBufferMockup(
                         buffer.toByteArray()));
 
         byte[] d = new byte[10];
@@ -332,7 +332,7 @@
     }
 
     public void testChunkedOutputStream() throws IOException {
-    	HttpDataTransmitterMockup buffer = new HttpDataTransmitterMockup();
+    	SessionOutputBufferMockup buffer = new SessionOutputBufferMockup();
         ChunkedOutputStream out = new ChunkedOutputStream(buffer, 2);
         out.write('1');  
         out.write('2');  
@@ -366,7 +366,7 @@
     }
 
     public void testChunkedOutputStreamLargeChunk() throws IOException {
-    	HttpDataTransmitterMockup buffer = new HttpDataTransmitterMockup();
+    	SessionOutputBufferMockup buffer = new SessionOutputBufferMockup();
         ChunkedOutputStream out = new ChunkedOutputStream(buffer, 2);
         out.write(new byte[] {'1', '2', '3', '4'});
         out.finish();
@@ -394,7 +394,7 @@
     public void testChunkedOutputStreamSmallChunk() throws IOException {
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         ChunkedOutputStream out = new ChunkedOutputStream(
-        		new HttpDataTransmitterMockup(buffer), 2);
+        		new SessionOutputBufferMockup(buffer), 2);
         out.write('1');  
         out.finish();
         out.close();

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java Fri Jul 27 12:30:42 2007
@@ -35,7 +35,7 @@
 import java.io.InputStream;
 
 import org.apache.http.impl.io.ContentLengthInputStream;
-import org.apache.http.mockup.HttpDataReceiverMockup;
+import org.apache.http.mockup.SessionInputBufferMockup;
 import org.apache.http.util.EncodingUtils;
 
 import junit.framework.Test;
@@ -63,7 +63,7 @@
     private static final String CONTENT_CHARSET = "ISO-8859-1";
         
     public void testConstructors() throws Exception {
-        new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[] {}), 10);
+        new ContentLengthInputStream(new SessionInputBufferMockup(new byte[] {}), 10);
         try {
             new ContentLengthInputStream(null, 10);
             fail("IllegalArgumentException should have been thrown");
@@ -71,7 +71,7 @@
             // expected
         }
         try {
-            new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[] {}), -10);
+            new ContentLengthInputStream(new SessionInputBufferMockup(new byte[] {}), -10);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -80,7 +80,7 @@
 
     public void testBasics() throws IOException {
         String correct = "1234567890123456";
-        InputStream in = new ContentLengthInputStream(new HttpDataReceiverMockup(
+        InputStream in = new ContentLengthInputStream(new SessionInputBufferMockup(
             EncodingUtils.getBytes(correct, CONTENT_CHARSET)), 10L);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
 
@@ -95,30 +95,30 @@
     }
 
     public void testSkip() throws IOException {
-        InputStream in = new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[20]), 10L);
+        InputStream in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[20]), 10L);
         assertEquals(10, in.skip(10));
         assertTrue(in.read() == -1);
 
-        in = new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[20]), 10L);
+        in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[20]), 10L);
         in.read();
         assertEquals(9, in.skip(10));
         assertTrue(in.read() == -1);
 
-        in = new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[20]), 2L);
+        in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[20]), 2L);
         in.read();
         in.read();
         assertTrue(in.skip(10) <= 0);
         assertTrue(in.skip(-1) == 0);
         assertTrue(in.read() == -1);
         
-        in = new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[2]), 4L);
+        in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[2]), 4L);
         in.read();
         assertTrue(in.skip(2) == 1);
     }
 
     public void testClose() throws IOException {
         String correct = "1234567890123456";
-        InputStream in = new ContentLengthInputStream(new HttpDataReceiverMockup(
+        InputStream in = new ContentLengthInputStream(new SessionInputBufferMockup(
             EncodingUtils.getBytes(correct, CONTENT_CHARSET)), 10L);
         in.close();
         in.close();

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java Fri Jul 27 12:30:42 2007
@@ -35,7 +35,7 @@
 import java.io.OutputStream;
 
 import org.apache.http.impl.io.ContentLengthOutputStream;
-import org.apache.http.mockup.HttpDataTransmitterMockup;
+import org.apache.http.mockup.SessionOutputBufferMockup;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -60,7 +60,7 @@
     }
 
     public void testConstructors() throws Exception {
-        new ContentLengthOutputStream(new HttpDataTransmitterMockup(), 10L);
+        new ContentLengthOutputStream(new SessionOutputBufferMockup(), 10L);
         try {
             new ContentLengthOutputStream(null, 10L);
             fail("IllegalArgumentException should have been thrown");
@@ -68,7 +68,7 @@
             // expected
         }
         try {
-            new ContentLengthOutputStream(new HttpDataTransmitterMockup(), -10);
+            new ContentLengthOutputStream(new SessionOutputBufferMockup(), -10);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -77,7 +77,7 @@
 
     public void testBasics() throws Exception {
     	ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-    	HttpDataTransmitterMockup datatransmitter = new HttpDataTransmitterMockup(buffer);
+    	SessionOutputBufferMockup datatransmitter = new SessionOutputBufferMockup(buffer);
     	OutputStream out = new ContentLengthOutputStream(datatransmitter, 15L);
 
         byte[] tmp = new byte[10];
@@ -96,7 +96,7 @@
 
     public void testClose() throws Exception {
     	ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-    	HttpDataTransmitterMockup datatransmitter = new HttpDataTransmitterMockup(buffer);
+    	SessionOutputBufferMockup datatransmitter = new SessionOutputBufferMockup(buffer);
     	OutputStream out = new ContentLengthOutputStream(datatransmitter, 15L);
     	out.close();
     	out.close();

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java?view=diff&rev=560358&r1=560357&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java Fri Jul 27 12:30:42 2007
@@ -35,7 +35,7 @@
 import java.io.OutputStream;
 
 import org.apache.http.impl.io.IdentityOutputStream;
-import org.apache.http.mockup.HttpDataTransmitterMockup;
+import org.apache.http.mockup.SessionOutputBufferMockup;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -60,7 +60,7 @@
     }
 
     public void testConstructors() throws Exception {
-        new IdentityOutputStream(new HttpDataTransmitterMockup());
+        new IdentityOutputStream(new SessionOutputBufferMockup());
         try {
             new IdentityOutputStream(null);
             fail("IllegalArgumentException should have been thrown");
@@ -71,7 +71,7 @@
 
     public void testBasics() throws Exception {
     	ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-    	HttpDataTransmitterMockup datatransmitter = new HttpDataTransmitterMockup(buffer);
+    	SessionOutputBufferMockup datatransmitter = new SessionOutputBufferMockup(buffer);
     	OutputStream out = new IdentityOutputStream(datatransmitter);
 
         byte[] tmp = new byte[10];
@@ -86,7 +86,7 @@
 
     public void testClose() throws Exception {
     	ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-    	HttpDataTransmitterMockup datatransmitter = new HttpDataTransmitterMockup(buffer);
+    	SessionOutputBufferMockup datatransmitter = new SessionOutputBufferMockup(buffer);
     	OutputStream out = new IdentityOutputStream(datatransmitter);
     	out.close();
     	out.close();
@@ -104,6 +104,56 @@
             // expected
         }
     }
+    
+    public void testConstructor() throws Exception {
+        SessionOutputBufferMockup transmitter = new SessionOutputBufferMockup();
+        new IdentityOutputStream(transmitter);
+        try {
+            new IdentityOutputStream(null);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException ex) {
+            //expected
+        }
+    }
+    
+    public void testBasicWrite() throws Exception {
+        SessionOutputBufferMockup transmitter = new SessionOutputBufferMockup();
+        IdentityOutputStream outstream = new IdentityOutputStream(transmitter);
+        outstream.write(new byte[] {'a', 'b'}, 0, 2);
+        outstream.write('c');
+        outstream.flush();
+        
+        byte[] input = transmitter.getData();
+        
+        assertNotNull(input);
+        byte[] expected = new byte[] {'a', 'b', 'c'};
+        assertEquals(expected.length, input.length);
+        for (int i = 0; i < expected.length; i++) {
+            assertEquals(expected[i], input[i]);
+        }
+    }
+    
+    public void testClosedCondition() throws Exception {
+        SessionOutputBufferMockup transmitter = new SessionOutputBufferMockup();
+        IdentityOutputStream outstream = new IdentityOutputStream(transmitter);
+        outstream.close();
+        outstream.close();
+        
+        try {
+            byte[] tmp = new byte[2];
+            outstream.write(tmp, 0, tmp.length);
+            fail("IOException should have been thrown");
+        } catch (IOException e) {
+            //expected
+        }
+        try {
+            outstream.write('a');
+            fail("IOException should have been thrown");
+        } catch (IOException e) {
+            //expected
+        }
+    }
+
     
 }
 

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentitynputStream.java (from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestHttpDataInputStream.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentitynputStream.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestHttpDataInputStream.java&r1=560343&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentitynputStream.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestHttpDataInputStream.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/impl/io/TestIdentitynputStream.java Fri Jul 27 12:30:42 2007
@@ -30,43 +30,43 @@
 
 package org.apache.http.impl.io;
 
-import org.apache.http.impl.io.HttpDataInputStream;
+import org.apache.http.impl.io.IdentityInputStream;
 import org.apache.http.io.SessionInputBuffer;
-import org.apache.http.mockup.HttpDataReceiverMockup;
+import org.apache.http.mockup.SessionInputBufferMockup;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 /**
- * Simple tests for {@link HttpDataInputStream}.
+ * Simple tests for {@link IdentityInputStream}.
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  */
-public class TestHttpDataInputStream extends TestCase {
+public class TestIdentitynputStream extends TestCase {
 
     // ------------------------------------------------------------ Constructor
-    public TestHttpDataInputStream(String testName) {
+    public TestIdentitynputStream(String testName) {
         super(testName);
     }
 
     // ------------------------------------------------------------------- Main
     public static void main(String args[]) {
-        String[] testCaseName = { TestHttpDataInputStream.class.getName() };
+        String[] testCaseName = { TestIdentitynputStream.class.getName() };
         junit.textui.TestRunner.main(testCaseName);
     }
 
     // ------------------------------------------------------- TestCase Methods
 
     public static Test suite() {
-        return new TestSuite(TestHttpDataInputStream.class);
+        return new TestSuite(TestIdentitynputStream.class);
     }
 
     public void testConstructor() throws Exception {
-        SessionInputBuffer receiver = new HttpDataReceiverMockup(new byte[] {});
-        new HttpDataInputStream(receiver);
+        SessionInputBuffer receiver = new SessionInputBufferMockup(new byte[] {});
+        new IdentityInputStream(receiver);
         try {
-            new HttpDataInputStream(null);
+            new IdentityInputStream(null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
@@ -75,8 +75,8 @@
     
     public void testBasicRead() throws Exception {
         byte[] input = new byte[] {'a', 'b', 'c'};
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(input);
-        HttpDataInputStream instream = new HttpDataInputStream(receiver);
+        SessionInputBufferMockup receiver = new SessionInputBufferMockup(input);
+        IdentityInputStream instream = new IdentityInputStream(receiver);
         byte[] tmp = new byte[2];
         assertEquals(2, instream.read(tmp, 0, tmp.length));
         assertEquals('a', tmp[0]);
@@ -90,8 +90,8 @@
     
     public void testClosedCondition() throws Exception {
         byte[] input = new byte[] {'a', 'b', 'c'};
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(input);
-        HttpDataInputStream instream = new HttpDataInputStream(receiver);
+        SessionInputBufferMockup receiver = new SessionInputBufferMockup(input);
+        IdentityInputStream instream = new IdentityInputStream(receiver);
 
         instream.close();
         instream.close();
@@ -106,8 +106,8 @@
 
     public void testAvailable() throws Exception {
         byte[] input = new byte[] {'a', 'b', 'c'};
-        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(input);
-        HttpDataInputStream instream = new HttpDataInputStream(receiver);
+        SessionInputBufferMockup receiver = new SessionInputBufferMockup(input);
+        IdentityInputStream instream = new IdentityInputStream(receiver);
         assertTrue(instream.available() > 0);        
     }
     

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java (from r560341, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataReceiverMockup.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataReceiverMockup.java&r1=560341&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataReceiverMockup.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java Fri Jul 27 12:30:42 2007
@@ -36,20 +36,20 @@
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 
-import org.apache.http.impl.io.AbstractHttpDataReceiver;
+import org.apache.http.impl.io.AbstractSessionInputBuffer;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 
 /**
- * {@link HttpDataInputStream} mockup implementation.
+ * {@link IdentityInputStream} mockup implementation.
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  */
-public class HttpDataReceiverMockup extends AbstractHttpDataReceiver {
+public class SessionInputBufferMockup extends AbstractSessionInputBuffer {
 
     public static int BUFFER_SIZE = 16;
     
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final InputStream instream, 
             int buffersize, 
             final HttpParams params) {
@@ -57,37 +57,37 @@
         init(instream, buffersize, params);
     }
 
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final InputStream instream, 
             int buffersize) {
         this(instream, buffersize, new BasicHttpParams());
     }
 
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final byte[] bytes, 
             final HttpParams params) {
         this(bytes, BUFFER_SIZE, params);
     }
 
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final byte[] bytes) {
         this(bytes, BUFFER_SIZE, new BasicHttpParams());
     }
 
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final byte[] bytes, 
             int buffersize, 
             final HttpParams params) {
         this(new ByteArrayInputStream(bytes), buffersize, params);
     }
 
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final byte[] bytes, 
             int buffersize) {
         this(new ByteArrayInputStream(bytes), buffersize, new BasicHttpParams());
     }
 
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final String s, 
             final String charset, 
             int buffersize,
@@ -96,7 +96,7 @@
         this(s.getBytes(charset), buffersize, params);
     }
     
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final String s, 
             final String charset, 
             int buffersize) 
@@ -104,7 +104,7 @@
         this(s.getBytes(charset), buffersize, new BasicHttpParams());
     }
     
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final String s, 
             final String charset,
             final HttpParams params) 
@@ -112,7 +112,7 @@
         this(s.getBytes(charset), params);
     }
     
-    public HttpDataReceiverMockup(
+    public SessionInputBufferMockup(
             final String s, 
             final String charset) 
         throws UnsupportedEncodingException {

Copied: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java (from r560343, jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataTransmitterMockup.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java?view=diff&rev=560358&p1=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataTransmitterMockup.java&r1=560343&p2=jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java&r2=560358
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/HttpDataTransmitterMockup.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java Fri Jul 27 12:30:42 2007
@@ -34,7 +34,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 
-import org.apache.http.impl.io.AbstractHttpDataTransmitter;
+import org.apache.http.impl.io.AbstractSessionOutputBuffer;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 
@@ -43,12 +43,12 @@
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  */
-public class HttpDataTransmitterMockup extends AbstractHttpDataTransmitter {
+public class SessionOutputBufferMockup extends AbstractSessionOutputBuffer {
 
     private ByteArrayOutputStream buffer = new ByteArrayOutputStream();
     public static int BUFFER_SIZE = 16;
     
-    public HttpDataTransmitterMockup(
+    public SessionOutputBufferMockup(
             final OutputStream outstream, 
             int buffersize,
             final HttpParams params) {
@@ -56,30 +56,30 @@
         init(outstream, buffersize, params);
     }
 
-    public HttpDataTransmitterMockup(
+    public SessionOutputBufferMockup(
             final OutputStream outstream, 
             int buffersize) {
         this(outstream, buffersize, new BasicHttpParams());
     }
 
-    public HttpDataTransmitterMockup(
+    public SessionOutputBufferMockup(
             final ByteArrayOutputStream buffer,
             final HttpParams params) {
         this(buffer, BUFFER_SIZE, params);
         this.buffer = buffer;
     }
 
-    public HttpDataTransmitterMockup(
+    public SessionOutputBufferMockup(
             final ByteArrayOutputStream buffer) {
         this(buffer, BUFFER_SIZE, new BasicHttpParams());
         this.buffer = buffer;
     }
 
-    public HttpDataTransmitterMockup(final HttpParams params) {
+    public SessionOutputBufferMockup(final HttpParams params) {
         this(new ByteArrayOutputStream(), params);
     }
 
-    public HttpDataTransmitterMockup() {
+    public SessionOutputBufferMockup() {
         this(new ByteArrayOutputStream(), new BasicHttpParams());
     }
 



Mime
View raw message