mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/utils/TestReflectionsUtil.java
@Test
    public void testRetrieveField()
    {
        Field field = ReflectionsUtil.retrieveField("DoseNotExist", m_Obj);
        assertThat(field, is(nullValue()));
        
        field = ReflectionsUtil.retrieveField("m_Integer", m_Obj);
        assertThat(field, is(notNullValue()));
        assertThat(field.getType(), is((Object)Integer.class));
        
        field = ReflectionsUtil.retrieveField("m_Boolean", m_Obj);
        assertThat(field, is(notNullValue()));
        assertThat(field.getType(), is((Object)Boolean.class));
        
        field = ReflectionsUtil.retrieveField("m_Float", m_Obj);
        assertThat(field, is(notNullValue()));
        assertThat(field.getType(), is((Object)Float.class));
    }
/**
     * Verify that a field can be retrieve from an object even if that field is inherited.
     */
Verify that a field can be retrieve from an object even if that field is inherited.
Verify that a field can be retrieve from an object even if that field is inherited .
@Test
    public void testRetrieveField()
    {
        Field field = ReflectionsUtil.retrieveField("DoseNotExist", m_Obj);
        assertThat(field, is(nullValue()));
        field = ReflectionsUtil.retrieveField("m_Integer", m_Obj);
        assertThat(field, is(notNullValue()));
        assertThat(field.getType(), is((Object)Integer.class));
        field = ReflectionsUtil.retrieveField("m_Boolean", m_Obj);
        assertThat(field, is(notNullValue()));
        assertThat(field.getType(), is((Object)Boolean.class));
        field = ReflectionsUtil.retrieveField("m_Float", m_Obj);
        assertThat(field, is(notNullValue()));
        assertThat(field.getType(), is((Object)Float.class));
    }
@ Test public void testRetrieveField ( ) { Field field = ReflectionsUtil . retrieveField ( "DoseNotExist" , m_Obj ) ; assertThat ( field , is ( nullValue ( ) ) ) ; field = ReflectionsUtil . retrieveField ( "m_Integer" , m_Obj ) ; assertThat ( field , is ( notNullValue ( ) ) ) ; assertThat ( field . getType ( ) , is ( ( Object ) Integer . class ) ) ; field = ReflectionsUtil . retrieveField ( "m_Boolean" , m_Obj ) ; assertThat ( field , is ( notNullValue ( ) ) ) ; assertThat ( field . getType ( ) , is ( ( Object ) Boolean . class ) ) ; field = ReflectionsUtil . retrieveField ( "m_Float" , m_Obj ) ; assertThat ( field , is ( notNullValue ( ) ) ) ; assertThat ( field . getType ( ) , is ( ( Object ) Float . class ) ) ; }
Verify that a field can be retrieve from an object even if that field is inherited.
Verify that a field can be retrieve from an object even if that field is inherited .