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.21 by jsr166, Thu Jan 15 18:34:19 2015 UTC vs.
Revision 1.22 by jsr166, Sat Jan 17 22:55:06 2015 UTC

# Line 419 | Line 419 | public class ConcurrentHashMap8Test exte
419              assertTrue(it.hasNext());
420              it.next();
421          }
422 <        assertFalse(it.hasNext());
423 <        try {
424 <            it.next();
425 <            shouldThrow();
426 <        } catch (NoSuchElementException success) {}
422 >        assertIteratorExhausted(it);
423 >    }
424 >
425 >    /**
426 >     * iterator of empty collections has no elements
427 >     */
428 >    public void testEmptyIterator() {
429 >        assertIteratorExhausted(ConcurrentHashMap.newKeySet().iterator());
430 >        assertIteratorExhausted(new ConcurrentHashMap().entrySet().iterator());
431 >        assertIteratorExhausted(new ConcurrentHashMap().values().iterator());
432 >        assertIteratorExhausted(new ConcurrentHashMap().keySet().iterator());
433      }
434  
435      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines