Changeset 12111 in josm for trunk/test/unit/org
- Timestamp:
- 2017-05-11T00:54:50+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
r11275 r12111 6 6 7 7 import java.lang.reflect.Field; 8 import java.lang.reflect.Method;9 8 import java.util.Arrays; 10 9 import java.util.Collection; 11 import java.util.Collections;12 10 13 11 import org.junit.Rule; … … 19 17 import org.openstreetmap.josm.data.osm.DataSet; 20 18 import org.openstreetmap.josm.data.osm.Node; 21 import org.openstreetmap.josm.data.osm.OsmPrimitive;22 19 import org.openstreetmap.josm.data.osm.Way; 23 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 44 41 45 42 /** 46 * FIXME: Conveniance method to prevent Selection Change events.47 * A more proper way should be to define a TestingDataSet class with limited48 * functionalities, but DataSet is declare as final (due to Cloneable interface).49 *50 * I don't know why, but in other tests there are no problem to add selected primitives51 * but in this case there is a problem with an even listener of selection change.52 * @param p primitive53 * @param ds data set54 * @throws ReflectiveOperationException if an error occurs55 */56 public void addSelected(OsmPrimitive p, DataSet ds) throws ReflectiveOperationException {57 Method method = ds.getClass().getDeclaredMethod("addSelected",58 new Class<?>[] {Collection.class, boolean.class});59 Utils.setObjectsAccessible(method);60 method.invoke(ds, Collections.singleton(p), false);61 }62 63 /**64 43 * Test case: When Create Circle action is performed with a single way selected, 65 44 * circle direction must equals way direction. … … 83 62 dataSet.addPrimitive(w); 84 63 85 addSelected(w, dataSet);64 dataSet.addSelected(w); 86 65 87 66 CreateCircleAction action = new CreateCircleAction(); … … 145 124 dataSet.addPrimitive(n3); 146 125 147 addSelected(n1, dataSet);148 addSelected(n2, dataSet);149 addSelected(n3, dataSet);126 dataSet.addSelected(n1); 127 dataSet.addSelected(n2); 128 dataSet.addSelected(n3); 150 129 151 130 // Mock left/right hand traffic database
Note:
See TracChangeset
for help on using the changeset viewer.