Code example for Attributes2Impl

Methods: isSpecified, setSpecified

0
 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        method = "isSpecified", 
        args = { int.class } 
    ) 
    public void testIsSpecifiedInt() { 
        // Ordinary cases 
        assertEquals(false, multi.isSpecified(1));
        assertEquals(true, multi.isSpecified(2));
         
        // Out of range 
        try { 
            multi.isSpecified(-1);
            fail("ArrayIndexOutOfBoundsException expected");
        } catch (ArrayIndexOutOfBoundsException e) {
            // Expected 
        } 
         
        try { 
            multi.isSpecified(4);
            fail("ArrayIndexOutOfBoundsException expected");
        } catch (ArrayIndexOutOfBoundsException e) {
            // Expected 
        } 
    } 
 
    @TestTargetNew( 
        level = TestLevel.COMPLETE,