Changeset 12562 in josm for trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
- Timestamp:
- 2017-08-03T19:57:36+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
r12110 r12562 6 6 7 7 import org.junit.Before; 8 import org.junit.Rule; 8 9 import org.junit.Test; 9 import org.openstreetmap.josm.JOSMFixture;10 10 import org.openstreetmap.josm.Main; 11 11 import org.openstreetmap.josm.actions.AlignInLineAction.InvalidSelection; … … 17 17 import org.openstreetmap.josm.data.osm.Way; 18 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 import org.openstreetmap.josm.testutils.JOSMTestRules; 20 21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 19 22 20 23 /** … … 23 26 public final class AlignInLineActionTest { 24 27 28 /** 29 * Setup test. 30 */ 31 @Rule 32 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 33 public JOSMTestRules test = new JOSMTestRules().mainMenu().projection(); 34 25 35 /** Class under test. */ 26 36 private static AlignInLineAction action; … … 31 41 @Before 32 42 public void setUp() { 33 JOSMFixture.createUnitTestFixture().init(true);34 35 43 // Enable "Align in line" feature. 36 44 action = Main.main.menu.alignInLine; … … 43 51 * https://josm.openstreetmap.de/ticket/9605#comment:3. Note that in this test, after alignment, way is overlapping 44 52 * itself. 45 */ 46 @Test 47 public void testNodesOpenWay() { 53 * @throws InvalidSelection never 54 */ 55 @Test 56 public void testNodesOpenWay() throws InvalidSelection { 48 57 DataSet dataSet = new DataSet(); 49 58 OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null); … … 67 76 dataSet.addSelected(point1, point2, point3); 68 77 69 action. actionPerformed(null);78 action.buildCommand().executeCommand(); 70 79 } finally { 71 80 // Ensure we clean the place before leaving, even if test fails. … … 82 91 * Test case: only nodes selected, part of a closed way: align these nodes on the line passing through the most 83 92 * distant nodes. 84 */ 85 @Test 86 public void testNodesClosedWay() { 93 * @throws InvalidSelection never 94 */ 95 @Test 96 public void testNodesClosedWay() throws InvalidSelection { 87 97 DataSet dataSet = new DataSet(); 88 98 OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null); … … 106 116 dataSet.addSelected(point4, point1, point2); 107 117 108 action. actionPerformed(null);118 action.buildCommand().executeCommand(); 109 119 } finally { 110 120 // Ensure we clean the place before leaving, even if test fails. … … 122 132 * Test case: only nodes selected, part of multiple ways: align these nodes on the line passing through the most 123 133 * distant nodes. 124 */ 125 @Test 126 public void testNodesOpenWays() { 134 * @throws InvalidSelection never 135 */ 136 @Test 137 public void testNodesOpenWays() throws InvalidSelection { 127 138 DataSet dataSet = new DataSet(); 128 139 OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null); … … 149 160 150 161 // Points must align between points 1 and 4. 151 action. actionPerformed(null);162 action.buildCommand().executeCommand(); 152 163 } finally { 153 164 // Ensure we clean the place before leaving, even if test fails.
Note:
See TracChangeset
for help on using the changeset viewer.