Changeset 15335 in josm for trunk/test/unit/org/openstreetmap/josm/data/validation
- Timestamp:
- 2019-09-04T11:43:24+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
r15034 r15335 14 14 import org.junit.Test; 15 15 import org.openstreetmap.josm.JOSMFixture; 16 import org.openstreetmap.josm.TestUtils; 16 17 import org.openstreetmap.josm.data.osm.DataSet; 18 import org.openstreetmap.josm.gui.MainApplication; 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 17 20 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 18 21 import org.openstreetmap.josm.io.IllegalDataException; … … 35 38 JOSMFixture.createUnitTestFixture().init(); 36 39 bib.initialize(); 37 bib.startTest(null);38 40 } 39 41 … … 48 50 try (InputStream fis = Files.newInputStream(Paths.get("data_nodist/UnconnectedWaysTest.osm"))) { 49 51 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 52 MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, null, null)); 53 54 bib.startTest(null); 55 bib.visit(ds.allPrimitives()); 56 bib.endTest(); 57 assertThat(bib.getErrors(), isEmpty()); 58 } 59 } 60 61 /** 62 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/6313">Bug #18051</a>. 63 * @throws IOException if any I/O error occurs 64 * @throws IllegalDataException if the OSM data cannot be parsed 65 * @throws FileNotFoundException if the data file cannot be found 66 */ 67 @Test 68 public void testTicket18051() throws IOException, IllegalDataException, FileNotFoundException { 69 try (InputStream fis = TestUtils.getRegressionDataStream(18051, "modified-ways.osm.bz2")) { 70 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 71 MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, null, null)); 72 73 bib.startTest(null); 74 bib.setBeforeUpload(true); 75 bib.visit(ds.allModifiedPrimitives()); 76 bib.endTest(); 77 assertThat(bib.getErrors(), isEmpty()); 78 } 79 } 80 81 /** 82 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/6313">Bug #18106</a>. 83 * @throws IOException if any I/O error occurs 84 * @throws IllegalDataException if the OSM data cannot be parsed 85 * @throws FileNotFoundException if the data file cannot be found 86 */ 87 @Test 88 public void testTicket18106() throws IOException, IllegalDataException, FileNotFoundException { 89 try (InputStream fis = TestUtils.getRegressionDataStream(18106, "uncon3.osm")) { 90 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 91 MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, null, null)); 92 93 bib.startTest(null); 94 bib.setBeforeUpload(true); 50 95 bib.visit(ds.allPrimitives()); 51 96 bib.endTest();
Note:
See TracChangeset
for help on using the changeset viewer.