/**
* Serialize an instance, restore it, and check for equality.
*/
public void testSerialization2() {
ChartRenderingInfo i1 = new ChartRenderingInfo();
i1.getPlotInfo().setDataArea(new Rectangle2D.Double(1.0, 2.0, 3.0,
4.0));
ChartRenderingInfo i2 = null;
try {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(i1);
out.close();
ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(
buffer.toByteArray()));
i2 = (ChartRenderingInfo) in.readObject();
in.close();
}
catch (Exception e) {
e.printStackTrace();
}
assertEquals(i1, i2);
assertEquals(i2, i2.getPlotInfo().getOwner());
}