Changeset 19033 in josm for trunk/test
- Timestamp:
- 2024-04-05T14:58:43+02:00 (10 months ago)
- Location:
- trunk/test
- Files:
-
- 6 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/OsmPbfImporterTest.java
r19024 r19033 24 24 import org.openstreetmap.josm.data.osm.AbstractPrimitive; 25 25 import org.openstreetmap.josm.data.osm.DataSet; 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; 26 27 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 27 28 import org.openstreetmap.josm.data.osm.Relation; 29 import org.openstreetmap.josm.data.osm.UploadPolicy; 28 30 import org.openstreetmap.josm.data.osm.Way; 29 31 import org.openstreetmap.josm.data.protobuf.ProtobufTest; … … 159 161 assertDoesNotThrow(() -> importer.parseDataSet(new ByteArrayInputStream(badData), NullProgressMonitor.INSTANCE)); 160 162 } 163 164 @Test 165 void testNonRegression23599a() throws IOException, IllegalDataException { 166 final DataSet dataSet; 167 try (InputStream inputStream = TestUtils.getRegressionDataStream(23599, "visible.osm.pbf")) { 168 dataSet = importer.parseDataSet(inputStream, NullProgressMonitor.INSTANCE); 169 } 170 assertTrue(dataSet.getNodes().stream().allMatch(OsmPrimitive::isVisible)); 171 assertTrue(dataSet.getWays().stream().allMatch(OsmPrimitive::isVisible)); 172 assertTrue(dataSet.getRelations().stream().allMatch(OsmPrimitive::isVisible)); 173 174 } 175 176 @Test 177 void testNonRegression23599b() throws IOException, IllegalDataException { 178 final DataSet dataSet; 179 // osmconvert w1194668585.orig.osm -o=w1194668585.full.osm.pbf 180 try (InputStream inputStream = TestUtils.getRegressionDataStream(23599, "w1194668585.full.osm.pbf")) { 181 dataSet = importer.parseDataSet(inputStream, NullProgressMonitor.INSTANCE); 182 } 183 assertNotNull(dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY)); 184 assertEquals(145987123, dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY).getChangesetId()); 185 assertEquals(4, dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY).getVersion()); 186 assertEquals(UploadPolicy.NORMAL, dataSet.getUploadPolicy()); 187 } 188 189 @Test 190 void testNonRegression23599c() throws IOException, IllegalDataException { 191 final DataSet dataSet; 192 // osmconvert --drop-author w1194668585.orig.osm -o=w1194668585.full.osm.pbf 193 try (InputStream inputStream = TestUtils.getRegressionDataStream(23599, "w1194668585.drop-author.osm.pbf")) { 194 dataSet = importer.parseDataSet(inputStream, NullProgressMonitor.INSTANCE); 195 } 196 assertNotNull(dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY)); 197 assertEquals(0, dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY).getChangesetId()); 198 assertEquals(4, dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY).getVersion()); 199 assertEquals(UploadPolicy.NORMAL, dataSet.getUploadPolicy()); 200 } 201 202 @Test 203 void testNonRegression23599d() throws IOException, IllegalDataException { 204 final DataSet dataSet; 205 // osmconvert --drop-version w1194668585.orig.osm -o=w1194668585.full.osm.pbf 206 try (InputStream inputStream = TestUtils.getRegressionDataStream(23599, "w1194668585.drop-version.osm.pbf")) { 207 dataSet = importer.parseDataSet(inputStream, NullProgressMonitor.INSTANCE); 208 } 209 assertNotNull(dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY)); 210 assertEquals(0, dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY).getChangesetId()); 211 assertEquals(0, dataSet.getPrimitiveById(1194668585L, OsmPrimitiveType.WAY).getVersion()); 212 assertEquals(UploadPolicy.DISCOURAGED, dataSet.getUploadPolicy()); 213 } 214 161 215 }
Note:
See TracChangeset
for help on using the changeset viewer.