Changeset 14542 in josm for trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
- Timestamp:
- 2018-12-09T23:58:32+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
r12828 r14542 7 7 import java.util.Arrays; 8 8 9 import org.junit.Before;10 9 import org.junit.Rule; 11 10 import org.junit.Test; … … 14 13 import org.openstreetmap.josm.data.osm.Node; 15 14 import org.openstreetmap.josm.data.osm.Way; 16 import org.openstreetmap.josm.gui.MainApplication;17 import org.openstreetmap.josm.gui.layer.OsmDataLayer;18 15 import org.openstreetmap.josm.testutils.JOSMTestRules; 19 16 … … 25 22 public final class SplitWayActionTest { 26 23 27 /** Class under test. */28 private static SplitWayAction action;29 30 24 /** 31 25 * Setup test. … … 33 27 @Rule 34 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules().main().projection(); 36 37 /** 38 * Setup test. 39 */ 40 @Before 41 public void setUp() { 42 if (action == null) { 43 action = MainApplication.getMenu().splitWay; 44 action.setEnabled(true); 45 } 46 } 29 public JOSMTestRules test = new JOSMTestRules().projection(); 47 30 48 31 /** … … 53 36 public void testTicket11184() { 54 37 DataSet dataSet = new DataSet(); 55 OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);56 38 57 39 Node n1 = new Node(new EastNorth(0, 0)); … … 81 63 dataSet.addSelected(w2); 82 64 83 try { 84 MainApplication.getLayerManager().addLayer(layer); 85 action.actionPerformed(null); 86 } finally { 87 // Ensure we clean the place before leaving, even if test fails. 88 MainApplication.getLayerManager().removeLayer(layer); 89 } 65 SplitWayAction.runOn(dataSet); 90 66 91 67 // Ensures 3 ways.
Note:
See TracChangeset
for help on using the changeset viewer.