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.4 by dl, Thu Apr 20 20:35:00 2006 UTC vs.
Revision 1.5 by jsr166, Mon Nov 2 20:28:31 2009 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);
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 81 | Line 81 | public class ConcurrentSkipListSubSetTes
81          return s;
82      }
83  
84 <    private static NavigableSet set0() {  
84 >    private static NavigableSet set0() {
85          ConcurrentSkipListSet set = new ConcurrentSkipListSet();
86          assertTrue(set.isEmpty());
87          return set.tailSet(m1, true);
88      }
89  
90 <    private static NavigableSet dset0() {  
90 >    private static NavigableSet dset0() {
91          ConcurrentSkipListSet set = new ConcurrentSkipListSet();
92          assertTrue(set.isEmpty());
93          return set;
94      }
95 <
95 >
96      /**
97       * A new set has unbounded capacity
98       */
# Line 138 | Line 138 | public class ConcurrentSkipListSubSetTes
138              NavigableSet q = set0();
139              q.add(null);
140              shouldThrow();
141 <        } catch (NullPointerException success) { }  
141 >        } catch (NullPointerException success) { }
142      }
143  
144      /**
# Line 255 | Line 255 | public class ConcurrentSkipListSubSetTes
255          }
256          assertTrue(q.isEmpty());
257      }
258 <        
258 >
259      /**
260       * contains(x) reports true when elements added but not yet removed
261       */
# Line 331 | Line 331 | public class ConcurrentSkipListSubSetTes
331          }
332      }
333  
334 <    
334 >
335  
336      /**
337       * lower returns preceding element
# Line 431 | Line 431 | public class ConcurrentSkipListSubSetTes
431          for(int i = 0; i < ints.length; i++)
432              assertEquals(ints[i], q.pollFirst());
433      }
434 <    
434 >
435      /**
436       * iterator iterates through all elements
437       */
# Line 489 | Line 489 | public class ConcurrentSkipListSubSetTes
489          for (int i = 0; i < SIZE; ++i) {
490              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
491          }
492 <    }        
492 >    }
493  
494      /**
495 <     * A deserialized serialized set has same elements
495 >     * A deserialized serialized set has same elements
496       */
497      public void testSerialization() {
498          NavigableSet q = populatedSet(SIZE);
# Line 506 | Line 506 | public class ConcurrentSkipListSubSetTes
506              ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
507              NavigableSet r = (NavigableSet)in.readObject();
508              assertEquals(q.size(), r.size());
509 <            while (!q.isEmpty())
509 >            while (!q.isEmpty())
510                  assertEquals(q.pollFirst(), r.pollFirst());
511          } catch(Exception e){
512              e.printStackTrace();
# Line 656 | Line 656 | public class ConcurrentSkipListSubSetTes
656              NavigableSet q = dset0();
657              q.add(null);
658              shouldThrow();
659 <        } catch (NullPointerException success) { }  
659 >        } catch (NullPointerException success) { }
660      }
661  
662      /**
# Line 773 | Line 773 | public class ConcurrentSkipListSubSetTes
773          }
774          assertTrue(q.isEmpty());
775      }
776 <        
776 >
777      /**
778       * contains(x) reports true when elements added but not yet removed
779       */
# Line 849 | Line 849 | public class ConcurrentSkipListSubSetTes
849          }
850      }
851  
852 <    
852 >
853  
854      /**
855       * lower returns preceding element
# Line 949 | Line 949 | public class ConcurrentSkipListSubSetTes
949          for(int i = 0; i < ints.length; i++)
950              assertEquals(ints[i], q.pollFirst());
951      }
952 <    
952 >
953      /**
954       * iterator iterates through all elements
955       */
# Line 1007 | Line 1007 | public class ConcurrentSkipListSubSetTes
1007          for (int i = 0; i < SIZE; ++i) {
1008              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
1009          }
1010 <    }        
1010 >    }
1011  
1012      /**
1013 <     * A deserialized serialized set has same elements
1013 >     * A deserialized serialized set has same elements
1014       */
1015      public void testDescendingSerialization() {
1016          NavigableSet q = populatedSet(SIZE);
# Line 1024 | Line 1024 | public class ConcurrentSkipListSubSetTes
1024              ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
1025              NavigableSet r = (NavigableSet)in.readObject();
1026              assertEquals(q.size(), r.size());
1027 <            while (!q.isEmpty())
1027 >            while (!q.isEmpty())
1028                  assertEquals(q.pollFirst(), r.pollFirst());
1029          } catch(Exception e){
1030              e.printStackTrace();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines