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

Comparing jsr166/src/test/tck/ConcurrentSkipListMapTest.java (file contents):
Revision 1.4 by dl, Sat May 28 14:02:00 2005 UTC vs.
Revision 1.5 by dl, Sat Oct 1 17:05:38 2005 UTC

# Line 463 | Line 463 | public class ConcurrentSkipListMapTest e
463  
464      }
465  
466 +    /**
467 +     * lowerEntry, higherEntry, ceilingEntry, and floorEntry return
468 +     * imutable entries
469 +     */
470 +    public void testEntryImmutablity() {
471 +        ConcurrentSkipListMap map = map5();
472 +        Map.Entry e = map.lowerEntry(three);
473 +        assertEquals(two, e.getKey());
474 +        try {
475 +            e.setValue("X");
476 +            fail();
477 +        } catch(UnsupportedOperationException success) {}
478 +        e = map.higherEntry(zero);
479 +        assertEquals(one, e.getKey());
480 +        try {
481 +            e.setValue("X");
482 +            fail();
483 +        } catch(UnsupportedOperationException success) {}
484 +        e = map.floorEntry(one);
485 +        assertEquals(one, e.getKey());
486 +        try {
487 +            e.setValue("X");
488 +            fail();
489 +        } catch(UnsupportedOperationException success) {}
490 +        e = map.ceilingEntry(five);
491 +        assertEquals(five, e.getKey());
492 +        try {
493 +            e.setValue("X");
494 +            fail();
495 +        } catch(UnsupportedOperationException success) {}
496 +    }
497 +
498 +
499  
500      /**
501       * lowerKey returns preceding element

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines