- Timestamp:
- 2020-06-17T00:05:03+02:00 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r14274 r16663 313 313 } 314 314 if (cs.getMax() != null) { 315 out.print(" max_lon='"+ DecimalDegreesCoordinateFormat.INSTANCE.lonToString(cs.getM in()) +'\'');316 out.print(" max_lat='"+ DecimalDegreesCoordinateFormat.INSTANCE.latToString(cs.getM in()) +'\'');315 out.print(" max_lon='"+ DecimalDegreesCoordinateFormat.INSTANCE.lonToString(cs.getMax()) +'\''); 316 out.print(" max_lat='"+ DecimalDegreesCoordinateFormat.INSTANCE.latToString(cs.getMax()) +'\''); 317 317 } 318 318 out.println(">"); -
trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java
r14746 r16663 9 9 import java.io.OutputStreamWriter; 10 10 import java.io.PrintWriter; 11 import java.io.StringWriter; 11 12 import java.nio.charset.StandardCharsets; 12 13 import java.util.ArrayList; … … 16 17 17 18 import org.junit.Test; 19 import org.openstreetmap.josm.data.coor.LatLon; 20 import org.openstreetmap.josm.data.osm.Changeset; 18 21 import org.openstreetmap.josm.data.osm.DataSet; 19 22 import org.openstreetmap.josm.data.osm.DownloadPolicy; 20 23 import org.openstreetmap.josm.data.osm.NodeData; 21 24 import org.openstreetmap.josm.data.osm.UploadPolicy; 25 import org.openstreetmap.josm.data.osm.User; 22 26 23 27 /** … … 91 95 .replaceAll("\n", "")); 92 96 } 97 98 /** 99 * Unit test of {@link OsmWriter#visit(Changeset)}. 100 * @throws IOException if an I/O error occurs 101 */ 102 @Test 103 public void testChangeset() throws IOException { 104 Changeset cs = new Changeset(); 105 cs.setUser(User.getAnonymous()); 106 cs.setId(38038262); 107 cs.setMin(new LatLon(12., 34.)); 108 cs.setMax(new LatLon(56., 78.)); 109 try (StringWriter stringWriter = new StringWriter(); 110 OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(stringWriter), true, OsmWriter.DEFAULT_API_VERSION)) { 111 osmWriter.visit(cs); 112 assertEquals(" <changeset id='38038262' user='<anonymous>' uid='-1' open='false' " + 113 "min_lon='34.0' min_lat='12.0' max_lon='78.0' max_lat='56.0'>\n </changeset>\n", 114 stringWriter.toString().replace("\r", "")); 115 } 116 } 93 117 }
Note:
See TracChangeset
for help on using the changeset viewer.