Changeset 9663 in josm for trunk/test/unit
- Timestamp:
- 2016-01-28T22:04:34+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
r9489 r9663 14 14 import org.openstreetmap.josm.actions.search.SearchAction; 15 15 import org.openstreetmap.josm.data.osm.DataSet; 16 import org.openstreetmap.josm.gui.layer.Layer; 16 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 17 18 import org.openstreetmap.josm.io.IllegalDataException; … … 40 41 try (InputStream is = TestUtils.getRegressionDataStream(10511, "10511_mini.osm")) { 41 42 DataSet ds = OsmReader.parseDataSet(is, null); 42 Main.map.mapView.addLayer(new OsmDataLayer(ds, null, null)); 43 Layer layer = new OsmDataLayer(ds, null, null); 44 Main.main.addLayer(layer); 43 45 // FIXME enable this test after we fix the bug. Test disabled for now 44 // new JoinAreasAction().join(ds.getWays()); 46 // try { 47 // new JoinAreasAction().join(ds.getWays()); 48 // } finally { 49 // Ensure we clean the place before leaving, even if test fails. 50 Main.main.removeLayer(layer); 51 // } 45 52 } 46 53 } … … 56 63 DataSet ds = OsmReader.parseDataSet(is, null); 57 64 assertEquals(10, ds.getWays().size()); 58 Main.map.mapView.addLayer(new OsmDataLayer(ds, null, null)); 59 for (String ref : new String[]{"A", "B", "C", "D", "E"}) { 60 System.out.print("Joining ways " + ref); 61 SearchAction.search("type:way ref="+ref, SearchAction.SearchMode.replace); 62 assertEquals(2, ds.getSelectedWays().size()); 63 Main.main.menu.joinAreas.join(ds.getSelectedWays()); 64 assertEquals(1, ds.getSelectedWays().size()); 65 System.out.println(" ==> OK"); 65 Layer layer = new OsmDataLayer(ds, null, null); 66 Main.main.addLayer(layer); 67 try { 68 for (String ref : new String[]{"A", "B", "C", "D", "E"}) { 69 System.out.print("Joining ways " + ref); 70 SearchAction.search("type:way ref="+ref, SearchAction.SearchMode.replace); 71 assertEquals(2, ds.getSelectedWays().size()); 72 Main.main.menu.joinAreas.join(ds.getSelectedWays()); 73 assertEquals(1, ds.getSelectedWays().size()); 74 System.out.println(" ==> OK"); 75 } 76 } finally { 77 // Ensure we clean the place before leaving, even if test fails. 78 Main.main.removeLayer(layer); 66 79 } 67 80 }
Note:
See TracChangeset
for help on using the changeset viewer.