jdk/test/java/util/Collection/MOAT.java
changeset 494 320ce398f07e
parent 493 b8102e80be10
child 2428 e63d91602813
equal deleted inserted replaced
493:b8102e80be10 494:320ce398f07e
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug     6207984 6272521 6192552 6269713 6197726 6260652 5073546 4137464
    26  * @bug     6207984 6272521 6192552 6269713 6197726 6260652 5073546 4137464
    27  *          4155650 4216399 4294891 6282555 6318622 6355327 6383475 6420753
    27  *          4155650 4216399 4294891 6282555 6318622 6355327 6383475 6420753
    28  *          6431845 4802633 6570566 6570575 6570631 6570924 6691185
    28  *          6431845 4802633 6570566 6570575 6570631 6570924 6691185 6691215
    29  * @summary Run many tests on many Collection and Map implementations
    29  * @summary Run many tests on many Collection and Map implementations
    30  * @author  Martin Buchholz
    30  * @author  Martin Buchholz
    31  */
    31  */
    32 
    32 
    33 /* Mother Of All (Collection) Tests
    33 /* Mother Of All (Collection) Tests
   245         equal(m.size(), 0);
   245         equal(m.size(), 0);
   246         equal(m.toString(),"{}");
   246         equal(m.toString(),"{}");
   247         testEmptySet(m.keySet());
   247         testEmptySet(m.keySet());
   248         testEmptySet(m.entrySet());
   248         testEmptySet(m.entrySet());
   249         testEmptyCollection(m.values());
   249         testEmptyCollection(m.values());
       
   250 
       
   251         try { check(! m.containsValue(null)); }
       
   252         catch (NullPointerException _) { /* OK */ }
       
   253         try { check(! m.containsKey(null)); }
       
   254         catch (NullPointerException _) { /* OK */ }
       
   255         check(! m.containsValue(1));
       
   256         check(! m.containsKey(1));
   250     }
   257     }
   251 
   258 
   252     private static void testImmutableMap(final Map<Integer,Integer> m) {
   259     private static void testImmutableMap(final Map<Integer,Integer> m) {
   253         THROWS(UnsupportedOperationException.class,
   260         THROWS(UnsupportedOperationException.class,
   254                new Fun(){void f(){ m.put(1,1); }},
   261                new Fun(){void f(){ m.put(1,1); }},