ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CopyOnWriteArrayListTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CopyOnWriteArrayListTest.java (file contents):
Revision 1.11 by jsr166, Sat Nov 21 02:07:26 2009 UTC vs.
Revision 1.12 by jsr166, Sat Nov 21 10:25:05 2009 UTC

# Line 189 | Line 189 | public class CopyOnWriteArrayListTest ex
189      }
190  
191      /**
192 <     *   get returns the  value at the given index
192 >     *   get returns the value at the given index
193       */
194      public void testGet() {
195          CopyOnWriteArrayList full = populatedArray(3);
# Line 247 | Line 247 | public class CopyOnWriteArrayListTest ex
247          try {
248              it.remove();
249              shouldThrow();
250 <        }
251 <        catch (UnsupportedOperationException success) {}
250 >        } catch (UnsupportedOperationException success) {}
251      }
252  
253      /**
# Line 598 | Line 597 | public class CopyOnWriteArrayListTest ex
597      /**
598       * a deserialized serialiszed list is equal
599       */
600 <    public void testSerialization() {
600 >    public void testSerialization() throws Exception {
601          CopyOnWriteArrayList q = populatedArray(SIZE);
602  
603 <        try {
604 <            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
605 <            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
606 <            out.writeObject(q);
607 <            out.close();
608 <
609 <            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
610 <            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
611 <            CopyOnWriteArrayList r = (CopyOnWriteArrayList)in.readObject();
612 <            assertEquals(q.size(), r.size());
613 <            assertTrue(q.equals(r));
615 <            assertTrue(r.equals(q));
616 <        } catch (Exception e) {
617 <            unexpectedException();
618 <        }
603 >        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
604 >        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
605 >        out.writeObject(q);
606 >        out.close();
607 >
608 >        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
609 >        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
610 >        CopyOnWriteArrayList r = (CopyOnWriteArrayList)in.readObject();
611 >        assertEquals(q.size(), r.size());
612 >        assertTrue(q.equals(r));
613 >        assertTrue(r.equals(q));
614      }
615  
616   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines