Changeset 10457 in josm for trunk/test/unit/org
- Timestamp:
- 2016-06-22T21:45:43+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
r10436 r10457 6 6 import java.io.IOException; 7 7 import java.io.InputStream; 8 import java.util.Collection; 8 9 9 10 import org.junit.BeforeClass; … … 14 15 import org.openstreetmap.josm.actions.search.SearchAction; 15 16 import org.openstreetmap.josm.data.osm.DataSet; 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 import org.openstreetmap.josm.data.osm.Way; 16 19 import org.openstreetmap.josm.gui.layer.Layer; 17 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 18 21 import org.openstreetmap.josm.io.IllegalDataException; 19 22 import org.openstreetmap.josm.io.OsmReader; 23 import org.openstreetmap.josm.tools.Utils; 20 24 21 25 /** … … 65 69 Layer layer = new OsmDataLayer(ds, null, null); 66 70 Main.getLayerManager().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.getLayerManager().removeLayer(layer); 71 for (String ref : new String[]{"A", "B", "C", "D", "E"}) { 72 System.out.print("Joining ways " + ref); 73 Collection<OsmPrimitive> found = SearchAction.searchAndReturn("type:way ref="+ref, SearchAction.SearchMode.replace); 74 assertEquals(2, found.size()); 75 76 Main.main.menu.joinAreas.join(Utils.filteredCollection(found, Way.class)); 77 78 Collection<OsmPrimitive> found2 = SearchAction.searchAndReturn("type:way ref="+ref, SearchAction.SearchMode.replace); 79 assertEquals(1, found2.size()); 80 System.out.println(" ==> OK"); 79 81 } 80 82 }
Note:
See TracChangeset
for help on using the changeset viewer.