Code example for Field

Methods: getLong

0
 
    /** 
     * @tests java.lang.reflect.Field#getFloat(java.lang.Object) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "getFloat", 
        args = {java.lang.Object.class}
    ) 
    public void test_getFloatLjava_lang_Object() { 
        // Test for method float 
        // java.lang.reflect.Field.getFloat(java.lang.Object) 
        TestField x = new TestField();
        Field f = null;
        float val = 0;
        try { 
            f = x.getClass().getDeclaredField("floatField");
            val = f.getFloat(x);
        } catch (Exception e) {
            fail("Exception during getFloat test : " + e.getMessage());