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

Comparing jsr166/src/test/tck/TreeSetTest.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:06 2009 UTC

# Line 669 | Line 669 | public class TreeSetTest extends JSR166T
669      /**
670       * Subsets of subsets subdivide correctly
671       */
672 <    public void testRecursiveSubSets() {
672 >    public void testRecursiveSubSets() throws Exception {
673          int setSize = 1000;
674          Class cl = TreeSet.class;
675  
# Line 688 | Line 688 | public class TreeSetTest extends JSR166T
688                     0, setSize - 1, true);
689      }
690  
691 <    static NavigableSet<Integer> newSet(Class cl) {
692 <        NavigableSet<Integer> result = null;
693 <        try {
694 <            result = (NavigableSet<Integer>) cl.newInstance();
695 <        } catch (Exception e) {
696 <            fail();
697 <        }
691 >    static NavigableSet<Integer> newSet(Class cl) throws Exception {
692 >        NavigableSet<Integer> result = (NavigableSet<Integer>) cl.newInstance();
693          assertEquals(result.size(), 0);
694          assertFalse(result.iterator().hasNext());
695          return result;
# Line 757 | Line 752 | public class TreeSetTest extends JSR166T
752              } else {
753                  try {
754                      set.add(element);
755 <                    fail();
756 <                } catch (IllegalArgumentException e) {
762 <                    // expected
763 <                }
755 >                    shouldThrow();
756 >                } catch (IllegalArgumentException success) {}
757              }
758          }
759      }
# Line 959 | Line 952 | public class TreeSetTest extends JSR166T
952              assertEq(rs.last(),  -1);
953              try {
954                  set.first();
955 <                fail();
956 <            } catch (NoSuchElementException e) {
964 <                // expected
965 <            }
955 >                shouldThrow();
956 >            } catch (NoSuchElementException success) {}
957              try {
958                  set.last();
959 <                fail();
960 <            } catch (NoSuchElementException e) {
970 <                // expected
971 <            }
959 >                shouldThrow();
960 >            } catch (NoSuchElementException success) {}
961          }
962      }
963  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines