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.16 by jsr166, Fri Nov 5 00:17:22 2010 UTC vs.
Revision 1.19 by jsr166, Fri May 27 19:21:27 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   import junit.framework.*;
# Line 97 | Line 97 | public class ConcurrentSkipListSubSetTes
97          assertEquals(0, set0().size());
98      }
99  
100
100      /**
101       * isEmpty is true before add, false after
102       */
# Line 168 | Line 167 | public class ConcurrentSkipListSubSetTes
167          } catch (ClassCastException success) {}
168      }
169  
171
170      /**
171       * addAll(null) throws NPE
172       */
# Line 239 | Line 237 | public class ConcurrentSkipListSubSetTes
237      public void testRemoveElement() {
238          NavigableSet q = populatedSet(SIZE);
239          for (int i = 1; i < SIZE; i+=2) {
240 <            assertTrue(q.remove(new Integer(i)));
240 >            assertTrue(q.contains(i));
241 >            assertTrue(q.remove(i));
242 >            assertFalse(q.contains(i));
243 >            assertTrue(q.contains(i-1));
244          }
245          for (int i = 0; i < SIZE; i+=2) {
246 <            assertTrue(q.remove(new Integer(i)));
247 <            assertFalse(q.remove(new Integer(i+1)));
246 >            assertTrue(q.contains(i));
247 >            assertTrue(q.remove(i));
248 >            assertFalse(q.contains(i));
249 >            assertFalse(q.remove(i+1));
250 >            assertFalse(q.contains(i+1));
251          }
252          assertTrue(q.isEmpty());
253      }
# Line 323 | Line 327 | public class ConcurrentSkipListSubSetTes
327          }
328      }
329  
326
327
330      /**
331       * lower returns preceding element
332       */
# Line 466 | Line 468 | public class ConcurrentSkipListSubSetTes
468          assertFalse(it.hasNext());
469      }
470  
469
471      /**
472       * toString contains toStrings of elements
473       */
# Line 474 | Line 475 | public class ConcurrentSkipListSubSetTes
475          NavigableSet q = populatedSet(SIZE);
476          String s = q.toString();
477          for (int i = 0; i < SIZE; ++i) {
478 <            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
478 >            assertTrue(s.contains(String.valueOf(i)));
479          }
480      }
481  
# Line 671 | Line 672 | public class ConcurrentSkipListSubSetTes
672          } catch (ClassCastException success) {}
673      }
674  
674
675      /**
676       * addAll(null) throws NPE
677       */
# Line 826 | Line 826 | public class ConcurrentSkipListSubSetTes
826          }
827      }
828  
829
830
829      /**
830       * lower returns preceding element
831       */
# Line 970 | Line 968 | public class ConcurrentSkipListSubSetTes
968          assertFalse(it.hasNext());
969      }
970  
973
971      /**
972       * toString contains toStrings of elements
973       */
# Line 978 | Line 975 | public class ConcurrentSkipListSubSetTes
975          NavigableSet q = populatedSet(SIZE);
976          String s = q.toString();
977          for (int i = 0; i < SIZE; ++i) {
978 <            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
978 >            assertTrue(s.contains(String.valueOf(i)));
979          }
980      }
981  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines