Code example for Attributes

Methods: equals, putValue

0
     * @tests java.util.jar.Attributes#Attributes(java.util.jar.Attributes) 
     */ 
    public void test_ConstructorLjava_util_jar_Attributes() { 
        Attributes a2 = new Attributes(a);
        assertEquals(a, a2);
        a.putValue("1", "one(1)");
        assertTrue("equal", !a.equals(a2));
    } 
 
    /** 
     * @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"));
    }