hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r385860 - in /jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl: TestAllImpl.java TestDefaultEntityDeserializer.java entity/TestAllEntityImpl.java entity/TestDefaultEntityDeserializer.java
Date Tue, 14 Mar 2006 19:25:28 GMT
Author: olegk
Date: Tue Mar 14 11:25:26 2006
New Revision: 385860

URL: http://svn.apache.org/viewcvs?rev=385860&view=rev
Log:
More test coverage

Added:
    jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java
  (contents, props changed)
      - copied, changed from r385835, jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestDefaultEntityDeserializer.java
Removed:
    jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestDefaultEntityDeserializer.java
Modified:
    jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestAllImpl.java
    jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestAllEntityImpl.java

Modified: jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestAllImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestAllImpl.java?rev=385860&r1=385859&r2=385860&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestAllImpl.java
(original)
+++ jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestAllImpl.java
Tue Mar 14 11:25:26 2006
@@ -41,7 +41,6 @@
         suite.addTest(TestHeaderGroup.suite());
         suite.addTest(TestHttpDataReceiverAndTransmitter.suite());
         suite.addTest(TestDefaultConnectionReuseStrategy.suite());
-        suite.addTest(TestDefaultEntityDeserializer.suite());
         suite.addTest(TestBasicRequest.suite());
         return suite;
     }

Modified: jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestAllEntityImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestAllEntityImpl.java?rev=385860&r1=385859&r2=385860&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestAllEntityImpl.java
(original)
+++ jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestAllEntityImpl.java
Tue Mar 14 11:25:26 2006
@@ -39,6 +39,7 @@
     public static Test suite() {
         TestSuite suite = new TestSuite();
         suite.addTest(TestDefaultEntitySerializer.suite());
+        suite.addTest(TestDefaultEntityDeserializer.suite());
         return suite;
     }
 

Copied: jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java
(from r385835, jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestDefaultEntityDeserializer.java)
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java?p2=jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java&p1=jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestDefaultEntityDeserializer.java&r1=385835&r2=385860&rev=385860&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/TestDefaultEntityDeserializer.java
(original)
+++ jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java
Tue Mar 14 11:25:26 2006
@@ -26,7 +26,7 @@
  *
  */
 
-package org.apache.http.impl;
+package org.apache.http.impl.entity;
 
 import java.io.InputStream;
 
@@ -325,5 +325,29 @@
         assertTrue(instream instanceof HttpDataInputStream);
     }
 
+    public void testEntityContentType() throws Exception {
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        HttpMessage message = new HttpMessageMockup();
+
+        message.addHeader(new Header("Content-Type", "stuff"));
+        EntityDeserializer entitygen = new DefaultEntityDeserializer();
+        HttpEntity entity = entitygen.deserialize(datareceiver, message);
+        assertNotNull(entity);
+        assertNotNull(entity.getContentType());
+        assertEquals("stuff", entity.getContentType().getValue());
+    }
+
+    public void testEntityContentEncoding() throws Exception {
+        HttpDataReceiver datareceiver = new HttpDataReceiverMockup(new byte[] {'0'});
+        HttpMessage message = new HttpMessageMockup();
+
+        message.addHeader(new Header("Content-Encoding", "what not"));
+        EntityDeserializer entitygen = new DefaultEntityDeserializer();
+        HttpEntity entity = entitygen.deserialize(datareceiver, message);
+        assertNotNull(entity);
+        assertNotNull(entity.getContentEncoding());
+        assertEquals("what not", entity.getContentEncoding().getValue());
+    }
+    
 }
 

Propchange: jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpcomponents/trunk/http-core/src/test/org/apache/http/impl/entity/TestDefaultEntityDeserializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message