hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r161634 - in jakarta/httpclient/trunk/http-common/src: java/org/apache/http/ java/org/apache/http/entity/ java/org/apache/http/impl/ test/org/apache/http/impl/
Date Sun, 17 Apr 2005 09:15:21 GMT
Author: olegk
Date: Sun Apr 17 02:15:17 2005
New Revision: 161634

URL: http://svn.apache.org/viewcvs?view=rev&rev=161634
Log:
Added HttpIncomingEntity interface

Added:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java
  (with props)
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java
  (with props)
Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpEntity.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableEntity.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableResponse.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpResponse.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/BufferedHttpEntity.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/EntityConsumer.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpEntity.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpResponse.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultEntityGenerator.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpClientConnection.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/EntityGenerator.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultResponseConsumedWatcher.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpEntity.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpEntity.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpEntity.java (original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpEntity.java Sun Apr
17 02:15:17 2005
@@ -29,8 +29,6 @@
 
 package org.apache.http;
 
-import java.io.InputStream;
-
 /**
  * <p>
  * </p>
@@ -49,7 +47,5 @@
     long getContentLength();
     
     String getContentType();
-    
-    InputStream getInputStream();
     
 }

Added: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java?view=auto&rev=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java
(added)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java
Sun Apr 17 02:15:17 2005
@@ -0,0 +1,47 @@
+/*
+ * $Header: $
+ * $Revision$
+ * $Date$
+ *
+ * ====================================================================
+ *
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http;
+
+import java.io.InputStream;
+
+/**
+ * <p>
+ * </p>
+ * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
+ *
+ * @version $Revision$
+ * 
+ * @since 4.0
+ */
+public interface HttpIncomingEntity extends HttpEntity {
+
+    InputStream getInputStream();
+    
+}

Propchange: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpIncomingEntity.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableEntity.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableEntity.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableEntity.java (original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableEntity.java Sun
Apr 17 02:15:17 2005
@@ -29,8 +29,6 @@
 
 package org.apache.http;
 
-import java.io.InputStream;
-
 /**
  * <p>
  * </p>
@@ -47,7 +45,5 @@
     void setContentType(String contentType);
     
     void setContentLength(long len);
-    
-    void setInputStream(InputStream instream);
     
 }

Added: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java?view=auto&rev=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java
(added)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java
Sun Apr 17 02:15:17 2005
@@ -0,0 +1,47 @@
+/*
+ * $Header: $
+ * $Revision$
+ * $Date$
+ *
+ * ====================================================================
+ *
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http;
+
+import java.io.InputStream;
+
+/**
+ * <p>
+ * </p>
+ * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
+ *
+ * @version $Revision$
+ * 
+ * @since 4.0
+ */
+public interface HttpMutableIncomingEntity extends HttpIncomingEntity, HttpMutableEntity
{
+
+    void setInputStream(InputStream instream);
+    
+}

Propchange: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableIncomingEntity.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableResponse.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableResponse.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableResponse.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpMutableResponse.java
Sun Apr 17 02:15:17 2005
@@ -40,6 +40,6 @@
  */
 public interface HttpMutableResponse extends HttpMutableMessage, HttpResponse {
 
-    void setEntity(HttpEntity entity);
+    void setEntity(HttpIncomingEntity entity);
     
 }

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpResponse.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpResponse.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpResponse.java (original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HttpResponse.java Sun Apr
17 02:15:17 2005
@@ -42,6 +42,6 @@
 
     StatusLine getStatusLine();
 
-    HttpEntity getEntity();
+    HttpIncomingEntity getEntity();
     
 }

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/BufferedHttpEntity.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/BufferedHttpEntity.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/BufferedHttpEntity.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/BufferedHttpEntity.java
Sun Apr 17 02:15:17 2005
@@ -33,7 +33,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.http.HttpEntity;
+import org.apache.http.HttpIncomingEntity;
 
 /**
  * <p>
@@ -44,12 +44,12 @@
  * 
  * @since 4.0
  */
-public class BufferedHttpEntity implements HttpEntity {
+public class BufferedHttpEntity implements HttpIncomingEntity {
     
-    private final HttpEntity source;
+    private final HttpIncomingEntity source;
     private final byte[] buffer;
     
-    public BufferedHttpEntity(final HttpEntity entity) throws IOException {
+    public BufferedHttpEntity(final HttpIncomingEntity entity) throws IOException {
         super();
         if (entity == null) {
             throw new IllegalArgumentException("HTTP entity may not be null");

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/EntityConsumer.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/EntityConsumer.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/EntityConsumer.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/entity/EntityConsumer.java
Sun Apr 17 02:15:17 2005
@@ -37,6 +37,7 @@
 
 import org.apache.http.HeaderElement;
 import org.apache.http.HttpEntity;
+import org.apache.http.HttpIncomingEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.NameValuePair;
 import org.apache.http.params.HttpProtocolParams;
@@ -62,7 +63,7 @@
         this.response = response;
     }
 
-    public static byte[] toByteArray(final HttpEntity entity) throws IOException {
+    public static byte[] toByteArray(final HttpIncomingEntity entity) throws IOException
{
         if (entity == null) {
             throw new IllegalArgumentException("HTTP entity may not be null");
         }
@@ -104,7 +105,7 @@
     }
 
     public static String toString(
-            final HttpEntity entity, final String defaultCharset) throws IOException {
+            final HttpIncomingEntity entity, final String defaultCharset) throws IOException
{
         if (entity == null) {
             throw new IllegalArgumentException("HTTP entity may not be null");
         }
@@ -131,12 +132,12 @@
         return buffer.toString();
     }
 
-    public static String toString(final HttpEntity entity) throws IOException {
+    public static String toString(final HttpIncomingEntity entity) throws IOException {
         return toString(entity, null);
     }
 
     public byte[] asByteArray() throws IOException {
-        HttpEntity entity = this.response.getEntity();
+        HttpIncomingEntity entity = this.response.getEntity();
         if (entity == null) {
             return new byte[] {};
         }
@@ -144,7 +145,7 @@
     }
     
     public String asString() throws IOException {
-        HttpEntity entity = this.response.getEntity();
+        HttpIncomingEntity entity = this.response.getEntity();
         if (entity == null) {
             return "";
         }

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpEntity.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpEntity.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpEntity.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpEntity.java
Sun Apr 17 02:15:17 2005
@@ -31,7 +31,7 @@
 
 import java.io.InputStream;
 
-import org.apache.http.HttpMutableEntity;
+import org.apache.http.HttpMutableIncomingEntity;
 
 /**
  * <p>
@@ -42,7 +42,7 @@
  * 
  * @since 4.0
  */
-public class BasicHttpEntity implements HttpMutableEntity {
+public class BasicHttpEntity implements HttpMutableIncomingEntity {
     
     private String contenttype = null;
     private InputStream instream = null;

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpResponse.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpResponse.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpResponse.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/BasicHttpResponse.java
Sun Apr 17 02:15:17 2005
@@ -29,7 +29,7 @@
 
 package org.apache.http.impl;
 
-import org.apache.http.HttpEntity;
+import org.apache.http.HttpIncomingEntity;
 import org.apache.http.HttpMutableResponse;
 import org.apache.http.StatusLine;
 
@@ -45,7 +45,7 @@
 public class BasicHttpResponse extends BasicHttpMessage implements HttpMutableResponse {
     
     private StatusLine statusline = null;
-    private HttpEntity entity = null;
+    private HttpIncomingEntity entity = null;
     
     public BasicHttpResponse(final StatusLine statusline) {
         super();
@@ -59,11 +59,11 @@
         return this.statusline; 
     }
 
-    public HttpEntity getEntity() {
+    public HttpIncomingEntity getEntity() {
         return this.entity;
     }
     
-    public void setEntity(final HttpEntity entity) {
+    public void setEntity(final HttpIncomingEntity entity) {
         this.entity = entity;
     }
     

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultEntityGenerator.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultEntityGenerator.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultEntityGenerator.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultEntityGenerator.java
Sun Apr 17 02:15:17 2005
@@ -36,7 +36,7 @@
 import org.apache.http.HeaderElement;
 import org.apache.http.HttpException;
 import org.apache.http.HttpMessage;
-import org.apache.http.HttpMutableEntity;
+import org.apache.http.HttpMutableIncomingEntity;
 import org.apache.http.ProtocolException;
 import org.apache.http.io.ChunkedInputStream;
 import org.apache.http.io.ContentLengthInputStream;
@@ -208,7 +208,7 @@
         }
     }
     
-    public HttpMutableEntity generate(
+    public HttpMutableIncomingEntity generate(
             final HttpDataReceiver datareceiver,
             final HttpMessage message) throws HttpException, IOException {
         if (datareceiver == null) {
@@ -218,7 +218,7 @@
             throw new IllegalArgumentException("HTTP message may not be null");
         }
 
-        HttpMutableEntity entity = new BasicHttpEntity();
+        HttpMutableIncomingEntity entity = new BasicHttpEntity();
         
         HttpParams params = message.getParams(); 
         boolean strict = params.isParameterTrue(HttpProtocolParams.STRICT_TRANSFER_ENCODING);

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpClientConnection.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpClientConnection.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpClientConnection.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpClientConnection.java
Sun Apr 17 02:15:17 2005
@@ -40,7 +40,7 @@
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
-import org.apache.http.HttpMutableEntity;
+import org.apache.http.HttpMutableIncomingEntity;
 import org.apache.http.HttpMutableResponse;
 import org.apache.http.HttpOutgoingEntity;
 import org.apache.http.HttpRequest;
@@ -279,7 +279,7 @@
     protected void processResponseBody(
             final HttpMutableResponse response) throws HttpException, IOException {
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpMutableEntity entity = entitygen.generate(this.datareceiver, response);
+        HttpMutableIncomingEntity entity = entitygen.generate(this.datareceiver, response);
         if (canResponseHaveBody(response)) {
             // if there is a result - ALWAYS wrap it in an observer which will
             // close the underlying stream as soon as it is consumed, and notify

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/EntityGenerator.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/EntityGenerator.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/EntityGenerator.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/EntityGenerator.java
Sun Apr 17 02:15:17 2005
@@ -33,7 +33,7 @@
 
 import org.apache.http.HttpException;
 import org.apache.http.HttpMessage;
-import org.apache.http.HttpMutableEntity;
+import org.apache.http.HttpMutableIncomingEntity;
 import org.apache.http.io.HttpDataReceiver;
 
 /**
@@ -47,7 +47,7 @@
  */
 public interface EntityGenerator {
 
-    HttpMutableEntity generate(
+    HttpMutableIncomingEntity generate(
             HttpDataReceiver datareceiver,
             HttpMessage message) throws HttpException, IOException;
             

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java
Sun Apr 17 02:15:17 2005
@@ -29,7 +29,7 @@
 package org.apache.http.impl;
 
 import org.apache.http.Header;
-import org.apache.http.HttpMutableEntity;
+import org.apache.http.HttpMutableIncomingEntity;
 import org.apache.http.HttpMutableResponse;
 import org.apache.http.HttpVersion;
 import org.apache.http.StatusLine;
@@ -67,7 +67,7 @@
     }
 
     public void testNoContentLengthResponse() throws Exception {
-        HttpMutableEntity entity = new BasicHttpEntity();
+        HttpMutableIncomingEntity entity = new BasicHttpEntity();
         entity.setChunked(false);
         entity.setContentLength(-1);
         StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_0, 200, "OK");
@@ -79,7 +79,7 @@
     }
 
     public void testExplicitClose() throws Exception {
-        HttpMutableEntity entity = new BasicHttpEntity();
+        HttpMutableIncomingEntity entity = new BasicHttpEntity();
         entity.setChunked(true);
         entity.setContentLength(-1);
         // Use HTTP 1.1
@@ -93,7 +93,7 @@
     }
     
     public void testExplicitKeepAlive() throws Exception {
-        HttpMutableEntity entity = new BasicHttpEntity();
+        HttpMutableIncomingEntity entity = new BasicHttpEntity();
         entity.setChunked(false);
         entity.setContentLength(10);
         // Use HTTP 1.0

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?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultEntityGenerator.java
Sun Apr 17 02:15:17 2005
@@ -32,7 +32,7 @@
 import java.io.InputStream;
 
 import org.apache.http.Header;
-import org.apache.http.HttpEntity;
+import org.apache.http.HttpIncomingEntity;
 import org.apache.http.HttpMutableMessage;
 import org.apache.http.ProtocolException;
 import org.apache.http.io.ChunkedInputStream;
@@ -91,7 +91,7 @@
         message.addHeader(new Header("Transfer-Encoding", "identity, chunked"));
         message.addHeader(new Header("Content-Length", "plain wrong"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertTrue(entity.isChunked());
@@ -117,7 +117,7 @@
         message.addHeader(new Header("Transfer-Encoding", "identity"));
         message.addHeader(new Header("Content-Length", "plain wrong"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -134,7 +134,7 @@
         message.addHeader(new Header("Transfer-Encoding", "whatever; param=value, chunked"));
         message.addHeader(new Header("Content-Length", "plain wrong"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertTrue(entity.isChunked());
@@ -160,7 +160,7 @@
         message.addHeader(new Header("Transfer-Encoding", "chunked, identity"));
         message.addHeader(new Header("Content-Length", "plain wrong"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -185,7 +185,7 @@
         message.addHeader(new Header("Content-Type", "unknown"));
         message.addHeader(new Header("Content-Length", "0"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(0, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -203,7 +203,7 @@
         message.addHeader(new Header("Content-Length", "0"));
         message.addHeader(new Header("Content-Length", "1"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(1, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -231,7 +231,7 @@
         message.addHeader(new Header("Content-Length", "yyy"));
         message.addHeader(new Header("Content-Length", "xxx"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(1, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -258,7 +258,7 @@
         message.addHeader(new Header("Content-Length", "yyy"));
         message.addHeader(new Header("Content-Length", "xxx"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -285,7 +285,7 @@
         message.addHeader(new Header("Content-Type", "unknown"));
         message.addHeader(new Header("Content-Length", "xxx"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -310,7 +310,7 @@
         // lenient mode 
         message.getParams().setBooleanParameter(HttpProtocolParams.STRICT_TRANSFER_ENCODING,
false);
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertFalse(entity.isChunked());
@@ -326,7 +326,7 @@
         HttpMutableMessage message = new BasicHttpMessage();
         message.addHeader(new Header("Content-Type", "unknown"));
         EntityGenerator entitygen = new DefaultEntityGenerator();
-        HttpEntity entity = entitygen.generate(datareceiver, message);
+        HttpIncomingEntity entity = entitygen.generate(datareceiver, message);
         assertNotNull(entity);
         assertEquals(-1, entity.getContentLength());
         assertFalse(entity.isChunked());

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultResponseConsumedWatcher.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultResponseConsumedWatcher.java?view=diff&r1=161633&r2=161634
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultResponseConsumedWatcher.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/impl/TestDefaultResponseConsumedWatcher.java
Sun Apr 17 02:15:17 2005
@@ -32,7 +32,7 @@
 
 import org.apache.http.Header;
 import org.apache.http.HttpConnection;
-import org.apache.http.HttpMutableEntity;
+import org.apache.http.HttpMutableIncomingEntity;
 import org.apache.http.HttpMutableResponse;
 import org.apache.http.HttpVersion;
 import org.apache.http.StatusLine;
@@ -79,7 +79,7 @@
     public void testConnectionAutoClose() throws Exception {
         byte[] data = new byte[] {'1', '2', '3'};
         HttpConnection conn = new HttpConnectionMockup();
-        HttpMutableEntity entity = new BasicHttpEntity();
+        HttpMutableIncomingEntity entity = new BasicHttpEntity();
         entity.setChunked(false);
         entity.setContentLength(data.length);
         entity.setInputStream(new ByteArrayInputStream(data));
@@ -103,7 +103,7 @@
     public void testConnectionKeepAlive() throws Exception {
         byte[] data = new byte[] {'1', '2', '3'};
         HttpConnection conn = new HttpConnectionMockup();
-        HttpMutableEntity entity = new BasicHttpEntity();
+        HttpMutableIncomingEntity entity = new BasicHttpEntity();
         entity.setChunked(false);
         entity.setContentLength(data.length);
         entity.setInputStream(new ByteArrayInputStream(data));



Mime
View raw message