Ignore:
Timestamp:
2016-10-08T15:28:54+02:00 (10 years ago)
Author:
Don-vip
Message:

convert unit tests from Groovy to Java

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/TestUtils.java

    r11102 r11104  
    99import java.io.IOException;
    1010import java.io.InputStream;
     11import java.lang.reflect.Field;
    1112import java.util.Arrays;
    1213import java.util.Collection;
     
    164165
    165166    /**
     167     * Returns a private field value.
     168     * @param obj object
     169     * @param fieldName private field name
     170     * @return private field value
     171     * @throws ReflectiveOperationException if a reflection operation error occurs
     172     */
     173    public static Object getPrivateField(Object obj, String fieldName) throws ReflectiveOperationException {
     174        Field f = obj.getClass().getDeclaredField(fieldName);
     175        f.setAccessible(true);
     176        return f.get(obj);
     177    }
     178
     179    /**
    166180     * Returns an instance of {@link AbstractProgressMonitor} which keeps track of the monitor state,
    167181     * but does not show the progress.
Note: See TracChangeset for help on using the changeset viewer.