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.3 by dl, Thu Apr 20 20:35:00 2006 UTC vs.
Revision 1.4 by jsr166, Mon Nov 2 20:28:31 2009 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);
18      }
19  
20 <    static class MyReverseComparator implements Comparator {
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();
# Line 57 | Line 57 | public class ConcurrentSkipListSetTest e
57          assertEquals(5, q.size());
58          return q;
59      }
60 <
60 >
61      /**
62       * A new set has unbounded capacity
63       */
# Line 172 | Line 172 | public class ConcurrentSkipListSetTest e
172              ConcurrentSkipListSet q = new ConcurrentSkipListSet();
173              q.add(null);
174              shouldThrow();
175 <        } catch (NullPointerException success) { }  
175 >        } catch (NullPointerException success) { }
176      }
177  
178      /**
# Line 301 | Line 301 | public class ConcurrentSkipListSetTest e
301          }
302          assertTrue(q.isEmpty());
303      }
304 <        
304 >
305      /**
306       * contains(x) reports true when elements added but not yet removed
307       */
# Line 377 | Line 377 | public class ConcurrentSkipListSetTest e
377          }
378      }
379  
380 <    
380 >
381  
382      /**
383       * lower returns preceding element
# Line 477 | Line 477 | public class ConcurrentSkipListSetTest e
477          for(int i = 0; i < ints.length; i++)
478              assertEquals(ints[i], q.pollFirst());
479      }
480 <    
480 >
481      /**
482       * iterator iterates through all elements
483       */
# Line 535 | Line 535 | public class ConcurrentSkipListSetTest e
535          for (int i = 0; i < SIZE; ++i) {
536              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
537          }
538 <    }        
538 >    }
539  
540      /**
541 <     * A deserialized serialized set has same elements
541 >     * A deserialized serialized set has same elements
542       */
543      public void testSerialization() {
544          ConcurrentSkipListSet q = populatedSet(SIZE);
# Line 552 | Line 552 | public class ConcurrentSkipListSetTest e
552              ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
553              ConcurrentSkipListSet r = (ConcurrentSkipListSet)in.readObject();
554              assertEquals(q.size(), r.size());
555 <            while (!q.isEmpty())
555 >            while (!q.isEmpty())
556                  assertEquals(q.pollFirst(), r.pollFirst());
557          } catch(Exception e){
558              e.printStackTrace();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines