Code example for Attributes

Methods: clear, isEmpty

0
 
    /** 
     * @tests java.util.jar.Attributes#isEmpty() 
     */ 
    public void test_isEmpty() { 
        assertTrue("Should not be empty", !a.isEmpty());
        a.clear();
        assertTrue("a) Should be empty", a.isEmpty());
        a = new Attributes();
        assertTrue("b) Should be empty", a.isEmpty());
    } 
 
    /** 
     * @tests java.util.jar.Attributes#keySet() 
     */ 
    public void test_keySet() { 
        Set<?> s = a.keySet();
        assertEquals(4, s.size());
        assertTrue("a) Should contain entry", s.contains(new Attributes.Name(
                "1"))); 
        assertTrue("b) Should contain entry", s.contains(new Attributes.Name(