Changeset 8803 in josm for trunk/test/unit
- Timestamp:
- 2015-09-29T18:56:18+02:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/io/session
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r8450 r8803 2 2 package org.openstreetmap.josm.io.session; 3 3 4 import static org.hamcrest.CoreMatchers.is; 4 5 import static org.junit.Assert.assertEquals; 5 6 import static org.junit.Assert.assertNotNull; 6 7 import static org.junit.Assert.assertSame; 8 import static org.junit.Assert.assertThat; 7 9 import static org.junit.Assert.assertTrue; 8 10 … … 16 18 import org.openstreetmap.josm.TestUtils; 17 19 import org.openstreetmap.josm.gui.layer.GpxLayer; 20 import org.openstreetmap.josm.gui.layer.ImageryLayer; 18 21 import org.openstreetmap.josm.gui.layer.Layer; 19 22 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 112 115 assertEquals(marker.getName(), "Marker layer name"); 113 116 } 117 118 @Test 119 public void testReadImage() throws IOException, IllegalDataException { 120 final List<Layer> layers = testRead("bing.jos"); 121 assertSame(layers.size(), 1); 122 assertTrue(layers.get(0) instanceof ImageryLayer); 123 final ImageryLayer image = (ImageryLayer) layers.get(0); 124 assertThat(image.getName(), is("Bing aerial imagery")); 125 assertEquals(image.getDx(), 12.34, 1e-9); 126 assertEquals(image.getDy(), -56.78, 1e-9); 127 } 114 128 } -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
r8510 r8803 4 4 import java.io.File; 5 5 import java.io.IOException; 6 import java.util.Arrays; 6 7 import java.util.Collections; 7 8 import java.util.HashMap; … … 15 16 import org.openstreetmap.josm.data.gpx.GpxData; 16 17 import org.openstreetmap.josm.data.gpx.WayPoint; 18 import org.openstreetmap.josm.data.imagery.ImageryInfo; 17 19 import org.openstreetmap.josm.data.osm.DataSet; 18 20 import org.openstreetmap.josm.gui.layer.GpxLayer; 21 import org.openstreetmap.josm.gui.layer.ImageryLayer; 19 22 import org.openstreetmap.josm.gui.layer.Layer; 20 23 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 24 import org.openstreetmap.josm.gui.layer.TMSLayer; 21 25 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 22 26 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 23 27 import org.openstreetmap.josm.tools.MultiMap; 24 import org.openstreetmap.josm.tools.Pair;25 28 26 29 /** … … 124 127 } 125 128 129 private ImageryLayer createImageryLayer() { 130 ImageryLayer layer = new TMSLayer(new ImageryInfo("the name", "http://www.url.com/")); 131 layer.setOffset(12, 34); 132 return layer; 133 } 134 126 135 /** 127 136 * Tests to write an empty .jos file. … … 185 194 public void testWriteGpxAndMarkerJoz() throws IOException { 186 195 GpxLayer gpx = createGpxLayer(); 187 testWrite(Pair.toList(new Pair<Layer, Layer>(gpx, createMarkerLayer(gpx))), true); 196 testWrite(Arrays.asList(gpx, createMarkerLayer(gpx)), true); 197 } 198 199 @Test 200 public void testWriteImageryLayer() throws IOException { 201 final Layer layer = createImageryLayer(); 202 testWrite(Collections.singletonList(layer), true); 188 203 } 189 204 }
Note:
See TracChangeset
for help on using the changeset viewer.