Code example for FieldPosition

Methods: getEndIndex, setBeginIndex, setEndIndex

0
        assertEquals(
                "FieldPosition(DateFormat.Field.MINUTE) should have caused getField to return -1", 
                -1, fpos2.getField());
    } 
 
    /** 
     * @tests java.text.FieldPosition#getFieldAttribute() 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "getFieldAttribute", 
        args = {} 
    ) 
    public void test_getFieldAttribute() { 
        // Test for method int java.text.FieldPosition.getFieldAttribute() 
        FieldPosition fpos = new FieldPosition(DateFormat.Field.TIME_ZONE);
        assertTrue(
                "FieldPosition(DateFormat.Field.TIME_ZONE) should have caused getFieldAttribute to return DateFormat.Field.TIME_ZONE", 
                fpos.getFieldAttribute() == DateFormat.Field.TIME_ZONE);