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.10 by jsr166, Sat Nov 21 17:38:05 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 ConcurrentSkipListSetTest 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(ConcurrentSkipListSetTest.class);
# Line 19 | Line 19 | public class ConcurrentSkipListSetTest e
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 245 | Line 241 | public class ConcurrentSkipListSetTest e
241          assertFalse(q.addAll(Arrays.asList(empty)));
242          assertTrue(q.addAll(Arrays.asList(ints)));
243          for (int i = 0; i < SIZE; ++i)
244 <            assertEquals(new Integer(i), q.pollFirst());
244 >            assertEquals(i, q.pollFirst());
245      }
246  
247      /**
# Line 254 | Line 250 | public class ConcurrentSkipListSetTest e
250      public void testPollFirst() {
251          ConcurrentSkipListSet q = populatedSet(SIZE);
252          for (int i = 0; i < SIZE; ++i) {
253 <            assertEquals(i, ((Integer)q.pollFirst()).intValue());
253 >            assertEquals(i, q.pollFirst());
254          }
255          assertNull(q.pollFirst());
256      }
# Line 265 | Line 261 | public class ConcurrentSkipListSetTest e
261      public void testPollLast() {
262          ConcurrentSkipListSet q = populatedSet(SIZE);
263          for (int i = SIZE-1; i >= 0; --i) {
264 <            assertEquals(i, ((Integer)q.pollLast()).intValue());
264 >            assertEquals(i, q.pollLast());
265          }
266          assertNull(q.pollFirst());
267      }
# Line 379 | Line 375 | public class ConcurrentSkipListSetTest e
375  
376          Object e4 = q.lower(zero);
377          assertNull(e4);
382
378      }
379  
380      /**
# Line 398 | Line 393 | public class ConcurrentSkipListSetTest e
393  
394          Object e4 = q.higher(six);
395          assertNull(e4);
401
396      }
397  
398      /**
# Line 417 | Line 411 | public class ConcurrentSkipListSetTest e
411  
412          Object e4 = q.floor(zero);
413          assertNull(e4);
420
414      }
415  
416      /**
# Line 436 | Line 429 | public class ConcurrentSkipListSetTest e
429  
430          Object e4 = q.ceiling(six);
431          assertNull(e4);
439
432      }
433  
434      /**
# Line 493 | Line 485 | public class ConcurrentSkipListSetTest e
485      /**
486       * iterator.remove removes current element
487       */
488 <    public void testIteratorRemove () {
488 >    public void testIteratorRemove() {
489          final ConcurrentSkipListSet q = new ConcurrentSkipListSet();
490          q.add(new Integer(2));
491          q.add(new Integer(1));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines