Changeset 7326 in josm for trunk/test/unit/org
- Timestamp:
- 2014-07-22T00:17:42+02:00 (10 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/io/session
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
r7081 r7326 13 13 import org.openstreetmap.josm.JOSMFixture; 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.data.coor.LatLon; 15 16 import org.openstreetmap.josm.data.gpx.GpxData; 17 import org.openstreetmap.josm.data.gpx.WayPoint; 16 18 import org.openstreetmap.josm.data.osm.DataSet; 17 19 import org.openstreetmap.josm.gui.MainApplication; … … 19 21 import org.openstreetmap.josm.gui.layer.Layer; 20 22 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 23 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 21 24 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences; 22 25 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 23 26 import org.openstreetmap.josm.tools.MultiMap; 27 import org.openstreetmap.josm.tools.Pair; 24 28 25 29 /** … … 106 110 107 111 private OsmDataLayer createOsmLayer() { 108 OsmDataLayer layer = new OsmDataLayer(new DataSet(), null, null);112 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "OSM layer name", null); 109 113 layer.setAssociatedFile(new File("data.osm")); 110 114 return layer; … … 112 116 113 117 private GpxLayer createGpxLayer() { 114 GpxLayer layer = new GpxLayer(new GpxData()); 118 GpxData data = new GpxData(); 119 data.waypoints.add(new WayPoint(new LatLon(42.72665, -0.00747))); 120 data.waypoints.add(new WayPoint(new LatLon(42.72659, -0.00749))); 121 GpxLayer layer = new GpxLayer(data, "GPX layer name"); 115 122 layer.setAssociatedFile(new File("data.gpx")); 116 123 return layer; 124 } 125 126 private MarkerLayer createMarkerLayer(GpxLayer gpx) { 127 return new MarkerLayer(gpx.data, "Marker layer name", gpx.getAssociatedFile(), gpx); 117 128 } 118 129 … … 170 181 testWrite(Collections.<Layer>singletonList(createGpxLayer()), true); 171 182 } 183 184 /** 185 * Tests to write a .joz file containing GPX and marker data. 186 * @throws IOException if any I/O error occurs 187 */ 188 @Test 189 public void testWriteGpxAndMarkerJoz() throws IOException { 190 GpxLayer gpx = createGpxLayer(); 191 testWrite(Pair.toArrayList(new Pair<Layer, Layer>(gpx, createMarkerLayer(gpx))), true); 192 } 172 193 }
Note:
See TracChangeset
for help on using the changeset viewer.