Changeset 14274 in josm for trunk/test/unit/org
- Timestamp:
- 2018-09-26T20:21:06+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java
r14201 r14274 16 16 17 17 import org.junit.Test; 18 import org.openstreetmap.josm.data.osm.DataSet; 18 19 import org.openstreetmap.josm.data.osm.DownloadPolicy; 19 20 import org.openstreetmap.josm.data.osm.NodeData; … … 69 70 baos.toString("UTF-8").replaceAll("\r", "").replaceAll("\n", "")); 70 71 } 72 73 /** 74 * Unit test of {@link OsmWriter#write} with dataset locked. 75 * @throws IOException if an I/O error occurs 76 */ 77 @Test 78 public void testWriteLock() throws IOException { 79 ByteArrayOutputStream baos = new ByteArrayOutputStream(); 80 try (PrintWriter out = new PrintWriter(new OutputStreamWriter(baos, StandardCharsets.UTF_8)); 81 OsmWriter writer = OsmWriterFactory.createOsmWriter(out, true, OsmWriter.DEFAULT_API_VERSION)) { 82 DataSet ds = new DataSet(); 83 ds.lock(); 84 writer.write(ds); 85 } 86 assertEquals("<?xml version='1.0' encoding='UTF-8'?><osm version='0.6' locked='true' generator='JOSM'></osm>", 87 baos.toString("UTF-8").replaceAll("\r", "").replaceAll("\n", "")); 88 } 71 89 }
Note:
See TracChangeset
for help on using the changeset viewer.