Changeset 15609 in josm for trunk/test
- Timestamp:
- 2019-12-23T22:41:07+01:00 (5 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/osm
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java
r13565 r15609 14 14 import org.junit.Rule; 15 15 import org.junit.Test; 16 import org.openstreetmap.josm.data.Bounds; 17 import org.openstreetmap.josm.data.DataSource; 16 18 import org.openstreetmap.josm.data.coor.LatLon; 19 import org.openstreetmap.josm.data.osm.event.DataSourceAddedEvent; 20 import org.openstreetmap.josm.data.osm.event.DataSourceRemovedEvent; 17 21 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 22 … … 248 252 assertTrue(UploadPolicy.DISCOURAGED.compareTo(UploadPolicy.NORMAL) > 0); 249 253 } 254 255 /** 256 * Checks that data source listeners get called when a data source is added 257 */ 258 @Test 259 public void testAddDataSourceListener() { 260 DataSourceListener addListener = new DataSourceListener() { 261 @Override 262 public void dataSourceChange(DataSourceChangeEvent event) { 263 assertTrue(event instanceof DataSourceAddedEvent); 264 } 265 }; 266 267 DataSet ds = new DataSet(); 268 ds.addDataSourceListener(addListener); 269 ds.addDataSource(new DataSource(new Bounds(0, 0, 0.1, 0.1), "fake source")); 270 271 } 272 273 /** 274 * Checks that data source listeners get called when a data source is removed 275 */ 276 @Test 277 public void testRemoveDataSourceListener() { 278 DataSourceListener removeListener = new DataSourceListener() { 279 @Override 280 public void dataSourceChange(DataSourceChangeEvent event) { 281 assertTrue(event instanceof DataSourceRemovedEvent); 282 } 283 }; 284 285 DataSet ds = new DataSet(); 286 ds.addDataSource(new DataSource(new Bounds(0, 0, 0.1, 0.1), "fake source")); 287 ds.addDataSourceListener(removeListener); 288 new DataSet().mergeFrom(ds); 289 } 250 290 }
Note:
See TracChangeset
for help on using the changeset viewer.