813 |
|
/** |
814 |
|
* A deserialized map equals original |
815 |
|
*/ |
816 |
< |
public void testSerialization() { |
816 |
> |
public void testSerialization() throws Exception { |
817 |
|
ConcurrentSkipListMap q = map5(); |
818 |
|
|
819 |
< |
try { |
820 |
< |
ByteArrayOutputStream bout = new ByteArrayOutputStream(10000); |
821 |
< |
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout)); |
822 |
< |
out.writeObject(q); |
823 |
< |
out.close(); |
819 |
> |
ByteArrayOutputStream bout = new ByteArrayOutputStream(10000); |
820 |
> |
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout)); |
821 |
> |
out.writeObject(q); |
822 |
> |
out.close(); |
823 |
|
|
824 |
< |
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray()); |
825 |
< |
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin)); |
826 |
< |
ConcurrentSkipListMap r = (ConcurrentSkipListMap)in.readObject(); |
827 |
< |
assertEquals(q.size(), r.size()); |
828 |
< |
assertTrue(q.equals(r)); |
829 |
< |
assertTrue(r.equals(q)); |
831 |
< |
} catch (Exception e) { |
832 |
< |
e.printStackTrace(); |
833 |
< |
unexpectedException(); |
834 |
< |
} |
824 |
> |
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray()); |
825 |
> |
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin)); |
826 |
> |
ConcurrentSkipListMap r = (ConcurrentSkipListMap)in.readObject(); |
827 |
> |
assertEquals(q.size(), r.size()); |
828 |
> |
assertTrue(q.equals(r)); |
829 |
> |
assertTrue(r.equals(q)); |
830 |
|
} |
831 |
|
|
832 |
|
|