604 |
|
/** |
605 |
|
* A deserialized map equals original |
606 |
|
*/ |
607 |
< |
public void testSerialization() { |
607 |
> |
public void testSerialization() throws Exception { |
608 |
|
ConcurrentNavigableMap q = map5(); |
609 |
|
|
610 |
< |
try { |
611 |
< |
ByteArrayOutputStream bout = new ByteArrayOutputStream(10000); |
612 |
< |
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout)); |
613 |
< |
out.writeObject(q); |
614 |
< |
out.close(); |
615 |
< |
|
616 |
< |
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray()); |
617 |
< |
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin)); |
618 |
< |
ConcurrentNavigableMap r = (ConcurrentNavigableMap)in.readObject(); |
619 |
< |
assertEquals(q.size(), r.size()); |
620 |
< |
assertTrue(q.equals(r)); |
621 |
< |
assertTrue(r.equals(q)); |
622 |
< |
} catch (Exception e) { |
623 |
< |
e.printStackTrace(); |
624 |
< |
unexpectedException(); |
625 |
< |
} |
610 |
> |
ByteArrayOutputStream bout = new ByteArrayOutputStream(10000); |
611 |
> |
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout)); |
612 |
> |
out.writeObject(q); |
613 |
> |
out.close(); |
614 |
> |
|
615 |
> |
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray()); |
616 |
> |
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin)); |
617 |
> |
ConcurrentNavigableMap r = (ConcurrentNavigableMap)in.readObject(); |
618 |
> |
assertEquals(q.size(), r.size()); |
619 |
> |
assertTrue(q.equals(r)); |
620 |
> |
assertTrue(r.equals(q)); |
621 |
|
} |
622 |
|
|
623 |
|
|
1298 |
|
/** |
1299 |
|
* A deserialized map equals original |
1300 |
|
*/ |
1301 |
< |
public void testDescendingSerialization() { |
1301 |
> |
public void testDescendingSerialization() throws Exception { |
1302 |
|
ConcurrentNavigableMap q = dmap5(); |
1303 |
|
|
1304 |
< |
try { |
1305 |
< |
ByteArrayOutputStream bout = new ByteArrayOutputStream(10000); |
1306 |
< |
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout)); |
1307 |
< |
out.writeObject(q); |
1308 |
< |
out.close(); |
1309 |
< |
|
1310 |
< |
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray()); |
1311 |
< |
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin)); |
1312 |
< |
ConcurrentNavigableMap r = (ConcurrentNavigableMap)in.readObject(); |
1313 |
< |
assertEquals(q.size(), r.size()); |
1314 |
< |
assertTrue(q.equals(r)); |
1320 |
< |
assertTrue(r.equals(q)); |
1321 |
< |
} catch (Exception e) { |
1322 |
< |
e.printStackTrace(); |
1323 |
< |
unexpectedException(); |
1324 |
< |
} |
1304 |
> |
ByteArrayOutputStream bout = new ByteArrayOutputStream(10000); |
1305 |
> |
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout)); |
1306 |
> |
out.writeObject(q); |
1307 |
> |
out.close(); |
1308 |
> |
|
1309 |
> |
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray()); |
1310 |
> |
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin)); |
1311 |
> |
ConcurrentNavigableMap r = (ConcurrentNavigableMap)in.readObject(); |
1312 |
> |
assertEquals(q.size(), r.size()); |
1313 |
> |
assertTrue(q.equals(r)); |
1314 |
> |
assertTrue(r.equals(q)); |
1315 |
|
} |
1316 |
|
|
1317 |
|
|
1328 |
– |
|
1318 |
|
/** |
1319 |
|
* subMap returns map with keys in requested range |
1320 |
|
*/ |