Code example for Attributes

Methods: clone, equals, putValue

0
 
    /** 
     * @tests java.util.jar.Attributes#clone() 
     */ 
    public void test_clone() { 
        Attributes a2 = (Attributes) a.clone();
        assertEquals(a, a2);
        a.putValue("1", "one(1)");
        assertTrue("equal", !a.equals(a2));
    } 
 
    /** 
     * @tests java.util.jar.Attributes#equals(java.lang.Object) 
     */ 
    public void test_equalsLjava_lang_Object() { 
        Attributes.Name n1 = new Attributes.Name("name"), n2 = new Attributes.Name(
                "Name"); 
        assertEquals(n1, n2);
        Attributes a1 = new Attributes();
        a1.putValue("one", "1");
        a1.putValue("two", "2");