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

Comparing jsr166/src/test/tck/ConcurrentHashMap8Test.java (file contents):
Revision 1.24 by jsr166, Fri Feb 27 21:03:10 2015 UTC vs.
Revision 1.29 by jsr166, Sun May 24 01:23:17 2015 UTC

# Line 26 | Line 26 | import junit.framework.TestSuite;
26  
27   public class ConcurrentHashMap8Test extends JSR166TestCase {
28      public static void main(String[] args) {
29 <        junit.textui.TestRunner.run(suite());
29 >        main(suite(), args);
30      }
31      public static Test suite() {
32          return new TestSuite(ConcurrentHashMap8Test.class);
# Line 163 | Line 163 | public class ConcurrentHashMap8Test exte
163          Set<Integer> a = ConcurrentHashMap.<Integer>newKeySet();
164          assertTrue(a.isEmpty());
165          for (int i = 0; i < n; i++)
166 <            a.add(i);
166 >            assertTrue(a.add(i));
167          assertEquals(n == 0, a.isEmpty());
168          assertEquals(n, a.size());
169          return a;
# Line 173 | Line 173 | public class ConcurrentHashMap8Test exte
173          Set<Integer> a = ConcurrentHashMap.<Integer>newKeySet();
174          assertTrue(a.isEmpty());
175          for (int i = 0; i < elements.length; i++)
176 <            a.add(elements[i]);
176 >            assertTrue(a.add(elements[i]));
177          assertFalse(a.isEmpty());
178          assertEquals(elements.length, a.size());
179          return a;
# Line 275 | Line 275 | public class ConcurrentHashMap8Test exte
275          try {
276              full.add(three);
277              shouldThrow();
278 <        } catch (UnsupportedOperationException e){}
278 >        } catch (UnsupportedOperationException success) {}
279      }
280  
281      /**
# Line 287 | Line 287 | public class ConcurrentHashMap8Test exte
287          try {
288              full.add(null);
289              shouldThrow();
290 <        } catch (NullPointerException e){}
290 >        } catch (NullPointerException success) {}
291      }
292  
293      /**
# Line 299 | Line 299 | public class ConcurrentHashMap8Test exte
299          try {
300              map.keySet(null);
301              shouldThrow();
302 <        } catch (NullPointerException e) {}
302 >        } catch (NullPointerException success) {}
303          ConcurrentHashMap.KeySetView set = map.keySet(one);
304 <        set.add(one);
305 <        set.add(six);
306 <        set.add(seven);
304 >        assertFalse(set.add(one));
305 >        assertTrue(set.add(six));
306 >        assertTrue(set.add(seven));
307          assertTrue(set.getMappedValue() == one);
308          assertTrue(map.get(one) != one);
309          assertTrue(map.get(six) == one);
# Line 516 | Line 516 | public class ConcurrentHashMap8Test exte
516          a = new Integer[0];
517          assertSame(a, empty.toArray(a));
518  
519 <        a = new Integer[size/2];
519 >        a = new Integer[size / 2];
520          Arrays.fill(a, 42);
521          assertSame(a, empty.toArray(a));
522          assertNull(a[0]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines