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.2 by dl, Tue Mar 22 01:30:22 2005 UTC vs.
Revision 1.5 by dl, Sat Oct 1 17:05:38 2005 UTC

# Line 192 | Line 192 | public class ConcurrentSkipListMapTest e
192          }
193      }
194  
195 +
196 +    /**
197 +     *  Values.toArray contains all values
198 +     */
199 +    public void testValuesToArray() {
200 +        ConcurrentSkipListMap map = map5();
201 +        Collection v = map.values();
202 +        Object[] ar = v.toArray();
203 +        ArrayList s = new ArrayList(Arrays.asList(ar));
204 +        assertEquals(5, ar.length);
205 +        assertTrue(s.contains("A"));
206 +        assertTrue(s.contains("B"));
207 +        assertTrue(s.contains("C"));
208 +        assertTrue(s.contains("D"));
209 +        assertTrue(s.contains("E"));
210 +    }
211 +
212      /**
213       * values collection contains all values
214       */
# Line 446 | 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
# Line 705 | Line 755 | public class ConcurrentSkipListMapTest e
755      }
756  
757      /**
758 +     * remove(x, null) returns false
759 +     */
760 +    public void testRemove3() {
761 +        try {
762 +            ConcurrentSkipListMap c = new ConcurrentSkipListMap();
763 +            c.put("sadsdf", "asdads");
764 +            assertFalse(c.remove("sadsdf", null));
765 +        } catch(NullPointerException e){
766 +            fail();
767 +        }
768 +    }
769 +
770 +    /**
771       * A deserialized map equals original
772       */
773      public void testSerialization() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines