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

Comparing jsr166/src/test/tck/ConcurrentSkipListSubSetTest.java (file contents):
Revision 1.10 by jsr166, Sat Nov 21 10:29:50 2009 UTC vs.
Revision 1.13 by jsr166, Wed Aug 25 00:07:03 2010 UTC

# Line 11 | Line 11 | import java.io.*;
11  
12   public class ConcurrentSkipListSubSetTest extends JSR166TestCase {
13      public static void main(String[] args) {
14 <        junit.textui.TestRunner.run (suite());
14 >        junit.textui.TestRunner.run(suite());
15      }
16      public static Test suite() {
17          return new TestSuite(ConcurrentSkipListSubSetTest.class);
# Line 19 | Line 19 | public class ConcurrentSkipListSubSetTes
19  
20      static class MyReverseComparator implements Comparator {
21          public int compare(Object x, Object y) {
22 <            int i = ((Integer)x).intValue();
23 <            int j = ((Integer)y).intValue();
24 <            if (i < j) return 1;
25 <            if (i > j) return -1;
26 <            return 0;
22 >            return ((Comparable)y).compareTo(x);
23          }
24      }
25  
# Line 229 | Line 225 | public class ConcurrentSkipListSubSetTes
225      public void testPoll() {
226          NavigableSet q = populatedSet(SIZE);
227          for (int i = 0; i < SIZE; ++i) {
228 <            assertEquals(i, ((Integer)q.pollFirst()).intValue());
228 >            assertEquals(i, q.pollFirst());
229          }
230          assertNull(q.pollFirst());
231      }
# Line 342 | Line 338 | public class ConcurrentSkipListSubSetTes
338  
339          Object e4 = q.lower(zero);
340          assertNull(e4);
345
341      }
342  
343      /**
# Line 361 | Line 356 | public class ConcurrentSkipListSubSetTes
356  
357          Object e4 = q.higher(six);
358          assertNull(e4);
364
359      }
360  
361      /**
# Line 380 | Line 374 | public class ConcurrentSkipListSubSetTes
374  
375          Object e4 = q.floor(zero);
376          assertNull(e4);
383
377      }
378  
379      /**
# Line 399 | Line 392 | public class ConcurrentSkipListSubSetTes
392  
393          Object e4 = q.ceiling(six);
394          assertNull(e4);
402
395      }
396  
397      /**
# Line 456 | Line 448 | public class ConcurrentSkipListSubSetTes
448      /**
449       * iterator.remove removes current element
450       */
451 <    public void testIteratorRemove () {
451 >    public void testIteratorRemove() {
452          final NavigableSet q = set0();
453          q.add(new Integer(2));
454          q.add(new Integer(1));
# Line 735 | Line 727 | public class ConcurrentSkipListSubSetTes
727      public void testDescendingPoll() {
728          NavigableSet q = populatedSet(SIZE);
729          for (int i = 0; i < SIZE; ++i) {
730 <            assertEquals(i, ((Integer)q.pollFirst()).intValue());
730 >            assertEquals(i, q.pollFirst());
731          }
732          assertNull(q.pollFirst());
733      }
# Line 848 | Line 840 | public class ConcurrentSkipListSubSetTes
840  
841          Object e4 = q.lower(zero);
842          assertNull(e4);
851
843      }
844  
845      /**
# Line 867 | Line 858 | public class ConcurrentSkipListSubSetTes
858  
859          Object e4 = q.higher(m6);
860          assertNull(e4);
870
861      }
862  
863      /**
# Line 886 | Line 876 | public class ConcurrentSkipListSubSetTes
876  
877          Object e4 = q.floor(zero);
878          assertNull(e4);
889
879      }
880  
881      /**
# Line 905 | Line 894 | public class ConcurrentSkipListSubSetTes
894  
895          Object e4 = q.ceiling(m6);
896          assertNull(e4);
908
897      }
898  
899      /**
# Line 962 | Line 950 | public class ConcurrentSkipListSubSetTes
950      /**
951       * iterator.remove removes current element
952       */
953 <    public void testDescendingIteratorRemove () {
953 >    public void testDescendingIteratorRemove() {
954          final NavigableSet q = dset0();
955          q.add(new Integer(2));
956          q.add(new Integer(1));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines