Code example for Attributes

Methods: clear, containsKey, get

0
 
    /** 
     * @tests java.util.jar.Attributes#clear() 
     */ 
    public void test_clear() { 
        a.clear();
        assertNull("a) All entries should be null after clear", a.get("1"));
        assertNull("b) All entries should be null after clear", a.get("2"));
        assertNull("c) All entries should be null after clear", a.get("3"));
        assertNull("d) All entries should be null after clear", a.get("4"));
        assertTrue("Should not contain any keys", !a.containsKey("1"));
    } 
 
    /** 
     * @tests java.util.jar.Attributes#containsKey(java.lang.Object) 
     */ 
    public void test_containsKeyLjava_lang_Object() { 
        assertTrue("a) Should have returned false", !a.containsKey(new Integer(
                1))); 
        assertTrue("b) Should have returned false", !a.containsKey("0"));
        assertTrue("Should have returned true", a