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

Comparing jsr166/src/test/tck/ConcurrentSkipListSetTest.java (file contents):
Revision 1.9 by jsr166, Sat Nov 21 10:29:50 2009 UTC vs.
Revision 1.10 by jsr166, Sat Nov 21 17:38:05 2009 UTC

# Line 664 | Line 664 | public class ConcurrentSkipListSetTest e
664      /**
665       * Subsets of subsets subdivide correctly
666       */
667 <    public void testRecursiveSubSets() {
667 >    public void testRecursiveSubSets() throws Exception {
668          int setSize = 1000;
669          Class cl = ConcurrentSkipListSet.class;
670  
# Line 683 | Line 683 | public class ConcurrentSkipListSetTest e
683                     0, setSize - 1, true);
684      }
685  
686 <    static NavigableSet<Integer> newSet(Class cl) {
687 <        NavigableSet<Integer> result = null;
688 <        try {
689 <            result = (NavigableSet<Integer>) cl.newInstance();
690 <        } catch (Exception e) {
691 <            fail();
692 <        }
686 >    static NavigableSet<Integer> newSet(Class cl) throws Exception {
687 >        NavigableSet<Integer> result = (NavigableSet<Integer>) cl.newInstance();
688          assertEquals(result.size(), 0);
689          assertFalse(result.iterator().hasNext());
690          return result;
# Line 752 | Line 747 | public class ConcurrentSkipListSetTest e
747              } else {
748                  try {
749                      set.add(element);
750 <                    fail();
751 <                } catch (IllegalArgumentException e) {
757 <                    // expected
758 <                }
750 >                    shouldThrow();
751 >                } catch (IllegalArgumentException success) {}
752              }
753          }
754      }
# Line 954 | Line 947 | public class ConcurrentSkipListSetTest e
947              assertEq(rs.last(),  -1);
948              try {
949                  set.first();
950 <                fail();
951 <            } catch (NoSuchElementException e) {
959 <                // expected
960 <            }
950 >                shouldThrow();
951 >            } catch (NoSuchElementException success) {}
952              try {
953                  set.last();
954 <                fail();
955 <            } catch (NoSuchElementException e) {
965 <                // expected
966 <            }
954 >                shouldThrow();
955 >            } catch (NoSuchElementException success) {}
956          }
957      }
958  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines