- Timestamp:
- 2018-09-26T20:21:06+02:00 (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r14215 r14274 121 121 } 122 122 if (locked) { 123 out.print("' locked= true");123 out.print("' locked='true"); 124 124 } 125 125 out.println("' generator='JOSM'>"); -
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.