Index: httpcore/src/test/java/org/apache/http/TestHttpVersion.java =================================================================== --- httpcore/src/test/java/org/apache/http/TestHttpVersion.java (revision 915300) +++ httpcore/src/test/java/org/apache/http/TestHttpVersion.java (working copy) @@ -27,6 +27,11 @@ package org.apache.http; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -118,5 +123,18 @@ assertEquals(orig, clone); } + public void testSerialization() throws Exception { + HttpVersion orig = HttpVersion.HTTP_1_1; + ByteArrayOutputStream outbuffer = new ByteArrayOutputStream(); + ObjectOutputStream outstream = new ObjectOutputStream(outbuffer); + outstream.writeObject(orig); + outstream.close(); + byte[] raw = outbuffer.toByteArray(); + ByteArrayInputStream inbuffer = new ByteArrayInputStream(raw); + ObjectInputStream instream = new ObjectInputStream(inbuffer); + HttpVersion clone = (HttpVersion) instream.readObject(); + assertEquals(orig, clone); + } + } Index: httpcore/src/test/java/org/apache/http/TestHttpHost.java =================================================================== --- httpcore/src/test/java/org/apache/http/TestHttpHost.java (revision 915300) +++ httpcore/src/test/java/org/apache/http/TestHttpHost.java (working copy) @@ -27,6 +27,11 @@ package org.apache.http; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -141,4 +146,17 @@ assertEquals(orig, clone); } + public void testSerialization() throws Exception { + HttpHost orig = new HttpHost("somehost", 8080, "https"); + ByteArrayOutputStream outbuffer = new ByteArrayOutputStream(); + ObjectOutputStream outstream = new ObjectOutputStream(outbuffer); + outstream.writeObject(orig); + outstream.close(); + byte[] raw = outbuffer.toByteArray(); + ByteArrayInputStream inbuffer = new ByteArrayInputStream(raw); + ObjectInputStream instream = new ObjectInputStream(inbuffer); + HttpHost clone = (HttpHost) instream.readObject(); + assertEquals(orig, clone); + } + }