"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/test/java/org/apache/http/impl/cookie/TestBasicClientCookie.java" between
httpcomponents-client-4.5.6-src.tar.gz and httpcomponents-client-4.5.7-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

TestBasicClientCookie.java  (httpcomponents-client-4.5.6-src):TestBasicClientCookie.java  (httpcomponents-client-4.5.7-src)
skipping to change at line 78 skipping to change at line 78
Assert.assertEquals(orig.getAttribute("attrib"), clone.getAttribute("att rib")); Assert.assertEquals(orig.getAttribute("attrib"), clone.getAttribute("att rib"));
} }
@Test @Test
public void testSerialization() throws Exception { public void testSerialization() throws Exception {
final BasicClientCookie orig = new BasicClientCookie("name", "value"); final BasicClientCookie orig = new BasicClientCookie("name", "value");
orig.setDomain("domain"); orig.setDomain("domain");
orig.setPath("/"); orig.setPath("/");
orig.setAttribute("attrib", "stuff"); orig.setAttribute("attrib", "stuff");
final ByteArrayOutputStream outbuffer = new ByteArrayOutputStream(); final ByteArrayOutputStream outbuffer = new ByteArrayOutputStream();
final ObjectOutputStream outstream = new ObjectOutputStream(outbuffer); final ObjectOutputStream outStream = new ObjectOutputStream(outbuffer);
outstream.writeObject(orig); outStream.writeObject(orig);
outstream.close(); outStream.close();
final byte[] raw = outbuffer.toByteArray(); final byte[] raw = outbuffer.toByteArray();
final ByteArrayInputStream inbuffer = new ByteArrayInputStream(raw); final ByteArrayInputStream inBuffer = new ByteArrayInputStream(raw);
final ObjectInputStream instream = new ObjectInputStream(inbuffer); final ObjectInputStream inStream = new ObjectInputStream(inBuffer);
final BasicClientCookie clone = (BasicClientCookie) instream.readObject( final BasicClientCookie clone = (BasicClientCookie) inStream.readObject(
); );
Assert.assertEquals(orig.getName(), clone.getName()); Assert.assertEquals(orig.getName(), clone.getName());
Assert.assertEquals(orig.getValue(), clone.getValue()); Assert.assertEquals(orig.getValue(), clone.getValue());
Assert.assertEquals(orig.getDomain(), clone.getDomain()); Assert.assertEquals(orig.getDomain(), clone.getDomain());
Assert.assertEquals(orig.getPath(), clone.getPath()); Assert.assertEquals(orig.getPath(), clone.getPath());
Assert.assertEquals(orig.getAttribute("attrib"), clone.getAttribute("att rib")); Assert.assertEquals(orig.getAttribute("attrib"), clone.getAttribute("att rib"));
} }
} }
 End of changes. 2 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)