Changeset 9925 in josm for trunk/test/unit
- Timestamp:
- 2016-03-05T10:22:33+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
r9924 r9925 5 5 6 6 import java.io.FileInputStream; 7 import java.util.ArrayList; 8 import java.util.List; 7 9 8 10 import org.junit.BeforeClass; … … 13 15 import org.openstreetmap.josm.data.coor.LatLon; 14 16 import org.openstreetmap.josm.data.osm.DataSet; 17 import org.openstreetmap.josm.data.osm.Node; 15 18 import org.openstreetmap.josm.data.osm.Way; 16 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 69 72 } 70 73 71 DataSet performTest(String search) throws Exception { 74 @Test 75 public void testFourNodes() throws Exception { 76 final DataSet ds = performTest( 77 "name=NodeToRectify-01", "name=NodeToRectify-02", "name=NodeToRectify-03", "name=NodeToRectify-04"); 78 final List<Node> nodes = new ArrayList<>(ds.getSelectedNodes()); 79 assertEquals(new LatLon(8.532735415272217, 55.72986948949525), nodes.get(0).getCoor()); 80 assertEquals(new LatLon(8.533520827858515, 55.73043325105434), nodes.get(1).getCoor()); 81 assertEquals(new LatLon(8.532914283300173, 55.73129729115582), nodes.get(2).getCoor()); 82 assertEquals(new LatLon(8.532055019939826, 55.73068052126457), nodes.get(3).getCoor()); 83 } 84 85 DataSet performTest(String... search) throws Exception { 72 86 try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "orthogonalize.osm")) { 73 87 final DataSet ds = OsmReader.parseDataSet(in, null); 74 ds.setSelected(Utils.filter(ds.allPrimitives(), SearchCompiler.compile(search))); 88 for (String s : search) { 89 ds.addSelected(Utils.filter(ds.allPrimitives(), SearchCompiler.compile(s))); 90 } 75 91 OrthogonalizeAction.orthogonalize(ds.getSelected()).executeCommand(); 76 92 return ds;
Note:
See TracChangeset
for help on using the changeset viewer.