Changeset 8949 in josm for trunk


Ignore:
Timestamp:
2015-10-26T01:10:35+01:00 (9 years ago)
Author:
Don-vip
Message:

see #11968, see #12011 - add a new non-regression unit test reproducing #12011

Location:
trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r8836 r8949  
    141141    // Map modes
    142142    public final SelectAction mapModeSelect;
     143    public final DrawAction mapModeDraw;
     144    public final ZoomAction mapModeZoom;
    143145    public LassoModeAction mapModeSelectLasso;
    144146
    145147    private final transient Map<Layer, MapMode> lastMapMode = new HashMap<>();
    146     private final MapMode mapModeDraw;
    147     private final MapMode mapModeZoom;
    148148
    149149    /**
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java

    r8857 r8949  
    77import static org.junit.Assert.fail;
    88
    9 import java.awt.Cursor;
    109import java.awt.event.InputEvent;
    1110import java.awt.event.MouseEvent;
    12 import java.awt.event.MouseListener;
    13 import java.awt.geom.Point2D;
    1411import java.lang.reflect.Field;
    1512import java.util.Arrays;
     
    2623import org.openstreetmap.josm.data.osm.Way;
    2724import org.openstreetmap.josm.gui.MapFrame;
    28 import org.openstreetmap.josm.gui.MapView;
    29 import org.openstreetmap.josm.gui.layer.Layer;
    3025import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3126
     
    3429 */
    3530public class SelectActionTest {
    36 
    37     private class MapViewMock extends MapView {
    38         private OsmDataLayer layer;
    39         private DataSet currentDataSet;
    40 
    41         MapViewMock(DataSet dataSet, OsmDataLayer layer) {
    42             super(null, null);
    43             this.layer = layer;
    44             this.currentDataSet = dataSet;
    45         }
    46 
    47         @Override
    48         public EastNorth getEastNorth(int x, int y) {
    49             return new EastNorth(x, y);
    50         }
    51 
    52         @Override
    53         public void addMouseListener(MouseListener ml) {}
    54 
    55         @Override
    56         public void removeMouseListener(MouseListener ml) {}
    57 
    58         @Override
    59         public void setVirtualNodesEnabled(boolean enabled) {}
    60 
    61         @Override
    62         public void setNewCursor(Cursor cursor, Object reference) {}
    63 
    64         @Override
    65         public void setNewCursor(int cursor, Object reference) {}
    66 
    67         @Override
    68         public boolean isActiveLayerVisible() {
    69             return true;
    70         }
    71 
    72         @Override
    73         public void requestClearRect() {}
    74 
    75         @Override
    76         public Point2D getPoint2D(EastNorth p) {
    77             return new Point2D.Double(p.getX(), p.getY());
    78         }
    79 
    80         @Override
    81         public void setActiveLayer(Layer layer) {}
    82 
    83         @Override
    84         public Layer getActiveLayer() {
    85             return layer;
    86         }
    87 
    88         @Override
    89         protected DataSet getCurrentDataSet() {
    90             return currentDataSet;
    91         }
    92     }
    9331
    9432    /**
     
    13472     */
    13573    @BeforeClass
    136     public static void setUp() {
     74    public static void setUpBeforeClass() {
    13775        JOSMFixture.createUnitTestFixture().init(true);
    13876    }
Note: See TracChangeset for help on using the changeset viewer.