hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r280910 - in /jakarta/httpclient/trunk/http-common/src/test/org/apache/http: impl/ io/ mockup/ util/
Date Wed, 14 Sep 2005 19:01:44 GMT
Author: olegk
Date: Wed Sep 14 12:01:32 2005
New Revision: 280910

URL: http://svn.apache.org/viewcvs?rev=280910&view=rev
Log:
Default HTTP data receiver and transmitter mockups renamed 

Added:
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataReceiverMockup.java
      - copied, changed from r280900, jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/InputStreamHttpDataReceiverMockup.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataTransmitterMockup.java
      - copied, changed from r280900, jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/OutputStreamHttpDataTransmitterMockup.java
Removed:
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/InputStreamHttpDataReceiverMockup.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/OutputStreamHttpDataTransmitterMockup.java
Modified:
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestOldIOHttpDataReceiverAndTransmitter.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestChunkCoding.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestContentLengthInputStream.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataInputStream.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataOutputStream.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestHeadersParser.java

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=280910&r1=280909&r2=280910&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
Wed Sep 14 12:01:32 2005
@@ -38,7 +38,7 @@
 import org.apache.http.io.ContentLengthInputStream;
 import org.apache.http.io.HttpDataInputStream;
 import org.apache.http.io.HttpDataReceiver;
-import org.apache.http.mockup.InputStreamHttpDataReceiverMockup;
+import org.apache.http.mockup.HttpDataReceiverMockup;
 import org.apache.http.params.HttpProtocolParams;
 
 import junit.framework.Test;
@@ -72,7 +72,7 @@
             // expected
         }
         try {
-            entitygen.generate(new InputStreamHttpDataReceiverMockup(new byte[] {}) , null);
+            entitygen.generate(new HttpDataReceiverMockup(new byte[] {}) , null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -80,7 +80,7 @@
     }
 
     public void testEntityWithTransferEncoding() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup("0\r\n", "US-ASCII");
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup("0\r\n", "US-ASCII");
         HttpMutableMessage message = new BasicHttpMessage();
         
         // lenient mode 
@@ -106,7 +106,7 @@
 
     public void testEntityWithIdentityTransferEncoding() throws Exception {
         HttpDataReceiver datareceiver = 
-        	new InputStreamHttpDataReceiverMockup(new byte[] {});
+        	new HttpDataReceiverMockup(new byte[] {});
         HttpMutableMessage message = new BasicHttpMessage();
         
         // lenient mode 
@@ -122,7 +122,7 @@
     }
 
     public void testEntityWithUnsupportedTransferEncoding() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup("0\r\n", "US-ASCII");
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup("0\r\n", "US-ASCII");
         HttpMutableMessage message = new BasicHttpMessage();
         
         // lenient mode 
@@ -148,7 +148,7 @@
     }
 
     public void testChunkedTransferEncodingMustBeLast() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup("0\r\n", "US-ASCII");
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup("0\r\n", "US-ASCII");
         HttpMutableMessage message = new BasicHttpMessage();
         
         // lenient mode 
@@ -174,7 +174,7 @@
     }
 
     public void testEntityWithContentLength() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup(new byte[]
{});
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {});
         HttpMutableMessage message = new BasicHttpMessage();
         
         // lenient mode 
@@ -190,7 +190,7 @@
     }
 
     public void testEntityWithMultipleContentLength() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup(new byte[]
{'0'});
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
         HttpMutableMessage message = new BasicHttpMessage();
 
         // lenient mode 
@@ -218,7 +218,7 @@
     }
     
     public void testEntityWithMultipleContentLengthSomeWrong() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup(new byte[]
{'0'});
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
         HttpMutableMessage message = new BasicHttpMessage();
 
         // lenient mode 
@@ -246,7 +246,7 @@
     }
     
     public void testEntityWithMultipleContentLengthAllWrong() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup(new byte[]
{'0'});
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
         HttpMutableMessage message = new BasicHttpMessage();
 
         // lenient mode 
@@ -274,7 +274,7 @@
     }
 
     public void testEntityWithInvalidContentLength() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup(new byte[]
{'0'});
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
         HttpMutableMessage message = new BasicHttpMessage();
 
         // lenient mode 
@@ -301,7 +301,7 @@
     }
 
     public void testEntityNeitherContentLengthNorTransferEncoding() throws Exception {
-        HttpDataReceiver datareceiver = new InputStreamHttpDataReceiverMockup(new byte[]
{'0'});
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
         HttpMutableMessage message = new BasicHttpMessage();
 
         // lenient mode 

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestOldIOHttpDataReceiverAndTransmitter.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestOldIOHttpDataReceiverAndTransmitter.java?rev=280910&r1=280909&r2=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestOldIOHttpDataReceiverAndTransmitter.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestOldIOHttpDataReceiverAndTransmitter.java
Wed Sep 14 12:01:32 2005
@@ -37,8 +37,8 @@
 import junit.framework.TestSuite;
 
 import org.apache.http.impl.DefaultHttpParams;
-import org.apache.http.mockup.InputStreamHttpDataReceiverMockup;
-import org.apache.http.mockup.OutputStreamHttpDataTransmitterMockup;
+import org.apache.http.mockup.HttpDataReceiverMockup;
+import org.apache.http.mockup.HttpDataTransmitterMockup;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
 
@@ -62,23 +62,23 @@
 
     public void testInit() throws Exception {
         ByteArrayOutputStream out = new ByteArrayOutputStream();
-        new OutputStreamHttpDataTransmitterMockup(out); 
+        new HttpDataTransmitterMockup(out); 
         try {
-            new OutputStreamHttpDataTransmitterMockup(null); 
+            new HttpDataTransmitterMockup(null); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
         }
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-        new InputStreamHttpDataReceiverMockup(in, 10); 
+        new HttpDataReceiverMockup(in, 10); 
         try {
-            new InputStreamHttpDataReceiverMockup(in, -10); 
+            new HttpDataReceiverMockup(in, -10); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
         }
         try {
-            new InputStreamHttpDataReceiverMockup((InputStream)null, 1024); 
+            new HttpDataReceiverMockup((InputStream)null, 1024); 
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
@@ -100,8 +100,8 @@
         teststrs[3] = "";
         teststrs[4] = "And goodbye";
         
-        OutputStreamHttpDataTransmitterMockup transmitter = 
-            new OutputStreamHttpDataTransmitterMockup(); 
+        HttpDataTransmitterMockup transmitter = 
+            new HttpDataTransmitterMockup(); 
         for (int i = 0; i < teststrs.length; i++) {
             transmitter.writeLine(teststrs[i]);
         }
@@ -109,8 +109,8 @@
         transmitter.writeLine(null);
         transmitter.flush();
         
-        InputStreamHttpDataReceiverMockup receiver = 
-            new InputStreamHttpDataReceiverMockup(transmitter.getData());
+        HttpDataReceiverMockup receiver = 
+            new HttpDataReceiverMockup(transmitter.getData());
 
         for (int i = 0; i < teststrs.length; i++) {
             assertEquals(teststrs[i], receiver.readLine());
@@ -120,8 +120,8 @@
     }
 
     public void testComplexReadWriteLine() throws Exception {
-        OutputStreamHttpDataTransmitterMockup transmitter = 
-            new OutputStreamHttpDataTransmitterMockup(); 
+        HttpDataTransmitterMockup transmitter = 
+            new HttpDataTransmitterMockup(); 
         transmitter.write(new byte[] {'a', '\n'});
         transmitter.write(new byte[] {'\r', '\n'});
         transmitter.write(new byte[] {'\r', '\r', '\n'});
@@ -162,8 +162,8 @@
         transmitter.write(new byte[] {'a'});
         transmitter.flush();
         
-        InputStreamHttpDataReceiverMockup receiver = 
-            new InputStreamHttpDataReceiverMockup(transmitter.getData());
+        HttpDataReceiverMockup receiver = 
+            new HttpDataReceiverMockup(transmitter.getData());
 
         assertEquals("a", receiver.readLine());
         assertEquals("", receiver.readLine());
@@ -192,8 +192,8 @@
         teststrs[3] = "";
         teststrs[4] = "And goodbye";
         
-        OutputStreamHttpDataTransmitterMockup transmitter = 
-            new OutputStreamHttpDataTransmitterMockup(); 
+        HttpDataTransmitterMockup transmitter = 
+            new HttpDataTransmitterMockup(); 
         for (int i = 0; i < teststrs.length; i++) {
             transmitter.writeLine(teststrs[i]);
         }
@@ -201,8 +201,8 @@
         transmitter.writeLine(null);
         transmitter.flush();
         
-        InputStreamHttpDataReceiverMockup receiver = 
-            new InputStreamHttpDataReceiverMockup(transmitter.getData(), 1024);
+        HttpDataReceiverMockup receiver = 
+            new HttpDataReceiverMockup(transmitter.getData(), 1024);
 
         for (int i = 0; i < teststrs.length; i++) {
             assertEquals(teststrs[i], receiver.readLine());
@@ -217,8 +217,8 @@
         for (int i = 0; i < out.length; i++) {
             out[i] = (byte)('0' + i);
         }
-        OutputStreamHttpDataTransmitterMockup transmitter = 
-            new OutputStreamHttpDataTransmitterMockup();
+        HttpDataTransmitterMockup transmitter = 
+            new HttpDataTransmitterMockup();
         int off = 0;
         int remaining = out.length;
         while (remaining > 0) {
@@ -238,8 +238,8 @@
             assertEquals(out[i], tmp[i]);
         }
         
-        InputStreamHttpDataReceiverMockup receiver = 
-            new InputStreamHttpDataReceiverMockup(tmp);
+        HttpDataReceiverMockup receiver = 
+            new HttpDataReceiverMockup(tmp);
 
         // these read operations will have no effect
         assertEquals(0, receiver.read(null, 0, 10));
@@ -273,8 +273,8 @@
         for (int i = 0; i < out.length; i++) {
             out[i] = (byte)('0' + i);
         }
-        OutputStreamHttpDataTransmitterMockup transmitter = 
-            new OutputStreamHttpDataTransmitterMockup();
+        HttpDataTransmitterMockup transmitter = 
+            new HttpDataTransmitterMockup();
         for (int i = 0; i < out.length; i++) {
             transmitter.write(out[i]);
         }
@@ -286,8 +286,8 @@
             assertEquals(out[i], tmp[i]);
         }
         
-        InputStreamHttpDataReceiverMockup receiver = 
-            new InputStreamHttpDataReceiverMockup(tmp);
+        HttpDataReceiverMockup receiver = 
+            new HttpDataReceiverMockup(tmp);
 
         byte[] in = new byte[40];
         for (int i = 0; i < in.length; i++) {
@@ -327,8 +327,8 @@
         HttpParams params = new DefaultHttpParams(null);
         HttpProtocolParams.setHttpElementCharset(params, "UTF-8");
         
-        OutputStreamHttpDataTransmitterMockup transmitter = 
-            new OutputStreamHttpDataTransmitterMockup();
+        HttpDataTransmitterMockup transmitter = 
+            new HttpDataTransmitterMockup();
         transmitter.reset(params);
 
         for (int i = 0; i < 10; i++) {
@@ -338,8 +338,8 @@
         }
         transmitter.flush();
         
-        InputStreamHttpDataReceiverMockup receiver = 
-            new InputStreamHttpDataReceiverMockup(transmitter.getData());
+        HttpDataReceiverMockup receiver = 
+            new HttpDataReceiverMockup(transmitter.getData());
         receiver.reset(params);
 
         for (int i = 0; i < 10; i++) {

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestChunkCoding.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestChunkCoding.java?rev=280910&r1=280909&r2=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestChunkCoding.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestChunkCoding.java
Wed Sep 14 12:01:32 2005
@@ -34,8 +34,8 @@
 import java.io.OutputStream;
 
 import org.apache.http.Header;
-import org.apache.http.mockup.InputStreamHttpDataReceiverMockup;
-import org.apache.http.mockup.OutputStreamHttpDataTransmitterMockup;
+import org.apache.http.mockup.HttpDataReceiverMockup;
+import org.apache.http.mockup.HttpDataTransmitterMockup;
 import org.apache.http.util.EncodingUtil;
 
 import junit.framework.Test;
@@ -82,7 +82,7 @@
     // Test for when buffer is larger than chunk size
     public void testChunkedInputStreamLargeBuffer() throws IOException {
         ChunkedInputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(CHUNKED_INPUT, CONTENT_CHARSET)));
         byte[] buffer = new byte[300];
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -110,7 +110,7 @@
     //Test for when buffer is smaller than chunk size.
     public void testChunkedInputStreamSmallBuffer() throws IOException {
         ChunkedInputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                             EncodingUtil.getBytes(CHUNKED_INPUT, CONTENT_CHARSET)));
 
         byte[] buffer = new byte[7];
@@ -138,7 +138,7 @@
     public void testChunkedInputStreamOneByteRead() throws IOException {
         String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         ChunkedInputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(s, CONTENT_CHARSET)));
         int ch;
         int i = '0';
@@ -155,7 +155,7 @@
     public void testChunkedInputStreamClose() throws IOException {
         String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         ChunkedInputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(s, CONTENT_CHARSET)));
         in.close();
         in.close();
@@ -184,7 +184,7 @@
     public void testCorruptChunkedInputStreamMissingCRLF() throws IOException {
         String s = "5\r\n012345\r\n56789\r\n0\r\n";
         InputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(s, CONTENT_CHARSET)));
         byte[] buffer = new byte[300];
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -203,7 +203,7 @@
     public void testCorruptChunkedInputStreamMissingLF() throws IOException {
         String s = "5\r01234\r\n5\r\n56789\r\n0\r\n";
         InputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(s, CONTENT_CHARSET)));
         try {
             in.read();
@@ -216,7 +216,7 @@
     // Missing closing chunk
     public void testCorruptChunkedInputStreamNoClosingChunk() throws IOException {
         InputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(new byte[] {}));
+                new HttpDataReceiverMockup(new byte[] {}));
         try {
             in.read();
             fail("MalformedChunkCodingException should have been thrown");
@@ -229,7 +229,7 @@
     public void testCorruptChunkedInputStreamInvalidSize() throws IOException {
         String s = "whatever\r\n01234\r\n5\r\n56789\r\n0\r\n";
         InputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(s, CONTENT_CHARSET)));
         try {
             in.read();
@@ -243,7 +243,7 @@
     public void testCorruptChunkedInputStreamInvalidFooter() throws IOException {
         String s = "1\r\n0\r\n0\r\nstuff\r\n";
         InputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(s, CONTENT_CHARSET)));
         try {
             in.read();
@@ -257,7 +257,7 @@
     public void testEmptyChunkedInputStream() throws IOException {
         String input = "0\r\n";
         InputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         EncodingUtil.getBytes(input, CONTENT_CHARSET)));
         byte[] buffer = new byte[300];
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -271,14 +271,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 OutputStreamHttpDataTransmitterMockup(buffer));
+        OutputStream out = new ChunkedOutputStream(new HttpDataTransmitterMockup(buffer));
         out.write(EncodingUtil.getBytes(input, CONTENT_CHARSET));
         out.flush();
         out.close();
         out.close();
         buffer.close();
         InputStream in = new ChunkedInputStream(
-                new InputStreamHttpDataReceiverMockup(
+                new HttpDataReceiverMockup(
                         buffer.toByteArray()));
 
         byte[] d = new byte[10];
@@ -293,7 +293,7 @@
     }
 
     public void testChunkedOutputStream() throws IOException {
-    	OutputStreamHttpDataTransmitterMockup buffer = new OutputStreamHttpDataTransmitterMockup();
+    	HttpDataTransmitterMockup buffer = new HttpDataTransmitterMockup();
         ChunkedOutputStream out = new ChunkedOutputStream(buffer, 2);
         out.write('1');  
         out.write('2');  
@@ -327,7 +327,7 @@
     }
 
     public void testChunkedOutputStreamLargeChunk() throws IOException {
-    	OutputStreamHttpDataTransmitterMockup buffer = new OutputStreamHttpDataTransmitterMockup();
+    	HttpDataTransmitterMockup buffer = new HttpDataTransmitterMockup();
         ChunkedOutputStream out = new ChunkedOutputStream(buffer, 2);
         out.write(new byte[] {'1', '2', '3', '4'});
         out.finish();
@@ -355,7 +355,7 @@
     public void testChunkedOutputStreamSmallChunk() throws IOException {
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         ChunkedOutputStream out = new ChunkedOutputStream(
-        		new OutputStreamHttpDataTransmitterMockup(buffer), 2);
+        		new HttpDataTransmitterMockup(buffer), 2);
         out.write('1');  
         out.finish();
         out.close();

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestContentLengthInputStream.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestContentLengthInputStream.java?rev=280910&r1=280909&r2=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestContentLengthInputStream.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestContentLengthInputStream.java
Wed Sep 14 12:01:32 2005
@@ -32,7 +32,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.http.mockup.InputStreamHttpDataReceiverMockup;
+import org.apache.http.mockup.HttpDataReceiverMockup;
 import org.apache.http.util.EncodingUtil;
 
 import junit.framework.Test;
@@ -60,7 +60,7 @@
     private static final String CONTENT_CHARSET = "ISO-8859-1";
         
     public void testConstructors() throws Exception {
-        new ContentLengthInputStream(new InputStreamHttpDataReceiverMockup(new byte[] {}),
10);
+        new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[] {}), 10);
         try {
             new ContentLengthInputStream(null, 10);
             fail("IllegalArgumentException should have been thrown");
@@ -68,7 +68,7 @@
             // expected
         }
         try {
-            new ContentLengthInputStream(new InputStreamHttpDataReceiverMockup(new byte[]
{}), -10);
+            new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[] {}), -10);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -77,7 +77,7 @@
 
     public void testBasics() throws IOException {
         String correct = "1234567890123456";
-        InputStream in = new ContentLengthInputStream(new InputStreamHttpDataReceiverMockup(
+        InputStream in = new ContentLengthInputStream(new HttpDataReceiverMockup(
             EncodingUtil.getBytes(correct, CONTENT_CHARSET)), 10L);
         ByteArrayOutputStream out = new ByteArrayOutputStream();
 
@@ -92,16 +92,16 @@
     }
 
     public void testSkip() throws IOException {
-        InputStream in = new ContentLengthInputStream(new InputStreamHttpDataReceiverMockup(new
byte[20]), 10L);
+        InputStream in = new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[20]),
10L);
         assertEquals(10, in.skip(10));
         assertTrue(in.read() == -1);
 
-        in = new ContentLengthInputStream(new InputStreamHttpDataReceiverMockup(new byte[20]),
10L);
+        in = new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[20]), 10L);
         in.read();
         assertEquals(9, in.skip(10));
         assertTrue(in.read() == -1);
 
-        in = new ContentLengthInputStream(new InputStreamHttpDataReceiverMockup(new byte[20]),
2L);
+        in = new ContentLengthInputStream(new HttpDataReceiverMockup(new byte[20]), 2L);
         in.read();
         in.read();
         assertTrue(in.skip(10) <= 0);
@@ -110,7 +110,7 @@
 
     public void testClose() throws IOException {
         String correct = "1234567890123456";
-        InputStream in = new ContentLengthInputStream(new InputStreamHttpDataReceiverMockup(
+        InputStream in = new ContentLengthInputStream(new HttpDataReceiverMockup(
             EncodingUtil.getBytes(correct, CONTENT_CHARSET)), 10L);
         in.close();
         in.close();

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataInputStream.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataInputStream.java?rev=280910&r1=280909&r2=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataInputStream.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataInputStream.java
Wed Sep 14 12:01:32 2005
@@ -28,7 +28,7 @@
 
 package org.apache.http.io;
 
-import org.apache.http.mockup.InputStreamHttpDataReceiverMockup;
+import org.apache.http.mockup.HttpDataReceiverMockup;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -59,7 +59,7 @@
     }
 
     public void testConstructor() throws Exception {
-        HttpDataReceiver receiver = new InputStreamHttpDataReceiverMockup(new byte[] {});
+        HttpDataReceiver receiver = new HttpDataReceiverMockup(new byte[] {});
         new HttpDataInputStream(receiver);
         try {
             new HttpDataInputStream(null);
@@ -71,7 +71,7 @@
     
     public void testBasicRead() throws Exception {
         byte[] input = new byte[] {'a', 'b', 'c'};
-        InputStreamHttpDataReceiverMockup receiver = new InputStreamHttpDataReceiverMockup(input);
+        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(input);
         HttpDataInputStream instream = new HttpDataInputStream(receiver);
         byte[] tmp = new byte[2];
         assertEquals(2, instream.read(tmp, 0, tmp.length));
@@ -86,7 +86,7 @@
     
     public void testClosedCondition() throws Exception {
         byte[] input = new byte[] {'a', 'b', 'c'};
-        InputStreamHttpDataReceiverMockup receiver = new InputStreamHttpDataReceiverMockup(input);
+        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(input);
         HttpDataInputStream instream = new HttpDataInputStream(receiver);
 
         instream.close();

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataOutputStream.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataOutputStream.java?rev=280910&r1=280909&r2=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataOutputStream.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/io/TestHttpDataOutputStream.java
Wed Sep 14 12:01:32 2005
@@ -28,7 +28,7 @@
 
 package org.apache.http.io;
 
-import org.apache.http.mockup.OutputStreamHttpDataTransmitterMockup;
+import org.apache.http.mockup.HttpDataTransmitterMockup;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -59,7 +59,7 @@
     }
 
     public void testConstructor() throws Exception {
-        OutputStreamHttpDataTransmitterMockup transmitter = new OutputStreamHttpDataTransmitterMockup();
+        HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup();
         new HttpDataOutputStream(transmitter);
         try {
             new HttpDataOutputStream(null);
@@ -70,7 +70,7 @@
     }
     
     public void testBasicWrite() throws Exception {
-    	OutputStreamHttpDataTransmitterMockup transmitter = new OutputStreamHttpDataTransmitterMockup();
+    	HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup();
         HttpDataOutputStream outstream = new HttpDataOutputStream(transmitter);
         outstream.write(new byte[] {'a', 'b'}, 0, 2);
         outstream.write('c');
@@ -87,7 +87,7 @@
     }
     
     public void testClosedCondition() throws Exception {
-    	OutputStreamHttpDataTransmitterMockup transmitter = new OutputStreamHttpDataTransmitterMockup();
+    	HttpDataTransmitterMockup transmitter = new HttpDataTransmitterMockup();
         HttpDataOutputStream outstream = new HttpDataOutputStream(transmitter);
         outstream.close();
         outstream.close();

Copied: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataReceiverMockup.java
(from r280900, jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/InputStreamHttpDataReceiverMockup.java)
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataReceiverMockup.java?p2=jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataReceiverMockup.java&p1=jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/InputStreamHttpDataReceiverMockup.java&r1=280900&r2=280910&rev=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/InputStreamHttpDataReceiverMockup.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataReceiverMockup.java
Wed Sep 14 12:01:32 2005
@@ -11,29 +11,29 @@
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  */
-public class InputStreamHttpDataReceiverMockup extends AbstractHttpDataReceiver {
+public class HttpDataReceiverMockup extends AbstractHttpDataReceiver {
 
     public static int BUFFER_SIZE = 16;
     
-    public InputStreamHttpDataReceiverMockup(final InputStream instream, int buffersize)
{
+    public HttpDataReceiverMockup(final InputStream instream, int buffersize) {
         super();
         init(instream, buffersize);
     }
 
-    public InputStreamHttpDataReceiverMockup(final byte[] bytes) {
+    public HttpDataReceiverMockup(final byte[] bytes) {
         this(bytes, BUFFER_SIZE);
     }
 
-    public InputStreamHttpDataReceiverMockup(final byte[] bytes, int buffersize) {
+    public HttpDataReceiverMockup(final byte[] bytes, int buffersize) {
         this(new ByteArrayInputStream(bytes), buffersize);
     }
 
-    public InputStreamHttpDataReceiverMockup(final String s, final String charset, int buffersize)

+    public HttpDataReceiverMockup(final String s, final String charset, int buffersize) 
         throws UnsupportedEncodingException {
         this(s.getBytes(charset), buffersize);
     }
     
-    public InputStreamHttpDataReceiverMockup(final String s, final String charset) 
+    public HttpDataReceiverMockup(final String s, final String charset) 
         throws UnsupportedEncodingException {
         this(s.getBytes(charset));
     

Copied: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataTransmitterMockup.java
(from r280900, jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/OutputStreamHttpDataTransmitterMockup.java)
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataTransmitterMockup.java?p2=jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataTransmitterMockup.java&p1=jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/OutputStreamHttpDataTransmitterMockup.java&r1=280900&r2=280910&rev=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/OutputStreamHttpDataTransmitterMockup.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/mockup/HttpDataTransmitterMockup.java
Wed Sep 14 12:01:32 2005
@@ -10,22 +10,22 @@
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  */
-public class OutputStreamHttpDataTransmitterMockup extends AbstractHttpDataTransmitter {
+public class HttpDataTransmitterMockup extends AbstractHttpDataTransmitter {
 
     private ByteArrayOutputStream buffer = new ByteArrayOutputStream();
     public static int BUFFER_SIZE = 16;
     
-    public OutputStreamHttpDataTransmitterMockup(final OutputStream outstream, int buffersize)
{
+    public HttpDataTransmitterMockup(final OutputStream outstream, int buffersize) {
         super();
         init(outstream, buffersize);
     }
 
-    public OutputStreamHttpDataTransmitterMockup(final ByteArrayOutputStream buffer) {
+    public HttpDataTransmitterMockup(final ByteArrayOutputStream buffer) {
         this(buffer, BUFFER_SIZE);
         this.buffer = buffer;
     }
 
-    public OutputStreamHttpDataTransmitterMockup() {
+    public HttpDataTransmitterMockup() {
         this(new ByteArrayOutputStream());
     }
 

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestHeadersParser.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestHeadersParser.java?rev=280910&r1=280909&r2=280910&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestHeadersParser.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/util/TestHeadersParser.java
Wed Sep 14 12:01:32 2005
@@ -31,7 +31,7 @@
 
 import org.apache.http.Header;
 import org.apache.http.io.HttpDataReceiver;
-import org.apache.http.mockup.InputStreamHttpDataReceiverMockup;
+import org.apache.http.mockup.HttpDataReceiverMockup;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -65,7 +65,7 @@
             "     and more stuff\r\n" + 
             "\t and even more stuff\r\n" +  
             "\r\n"; 
-        HttpDataReceiver receiver = new InputStreamHttpDataReceiverMockup(s, "US-ASCII");

+        HttpDataReceiver receiver = new HttpDataReceiverMockup(s, "US-ASCII"); 
         Header[] headers = HeadersParser.processHeaders(receiver);
         assertNotNull(headers);
         assertEquals(3, headers.length);
@@ -81,7 +81,7 @@
         String s = 
             "    header1: stuff\r\n" + 
             "header2  : stuff \r\n"; 
-        HttpDataReceiver receiver = new InputStreamHttpDataReceiverMockup(s, "US-ASCII");

+        HttpDataReceiver receiver = new HttpDataReceiverMockup(s, "US-ASCII"); 
         Header[] headers = HeadersParser.processHeaders(receiver);
         assertNotNull(headers);
         assertEquals(2, headers.length);
@@ -93,7 +93,7 @@
     
     public void testEmptyDataStream() throws Exception {
         String s = ""; 
-        HttpDataReceiver receiver = new InputStreamHttpDataReceiverMockup(s, "US-ASCII");

+        HttpDataReceiver receiver = new HttpDataReceiverMockup(s, "US-ASCII"); 
         Header[] headers = HeadersParser.processHeaders(receiver);
         assertNotNull(headers);
         assertEquals(0, headers.length);



Mime
View raw message