Changeset 9753 in josm
- Timestamp:
- 2016-02-07T18:08:55+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/session/GenericSessionExporter.java
r9746 r9753 208 208 } else { 209 209 try { 210 file.appendChild(support.createTextNode(layer.getAssociatedFile().toURI().toURL().toString())); 210 File f = layer.getAssociatedFile(); 211 if (f != null) { 212 file.appendChild(support.createTextNode(f.toURI().toURL().toString())); 213 } 211 214 } catch (MalformedURLException e) { 212 215 throw new IOException(e); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java
r9742 r9753 77 77 } 78 78 79 /** 80 * Unit test of {@link CorrelateGpxWithImages.Timezone#formatTimezone}. 81 */ 79 82 @Test 80 public void testFormatTimezone() throws Exception{83 public void testFormatTimezone() { 81 84 assertEquals("+1:00", new CorrelateGpxWithImages.Timezone(1).formatTimezone()); 82 85 assertEquals("+6:30", new CorrelateGpxWithImages.Timezone(6.5).formatTimezone()); … … 86 89 } 87 90 91 /** 92 * Unit test of {@link CorrelateGpxWithImages.Timezone#parseTimezone}. 93 * @throws ParseException in case of parsing error 94 */ 88 95 @Test 89 96 public void testParseTimezone() throws ParseException { … … 94 101 } 95 102 103 /** 104 * Unit test of {@link CorrelateGpxWithImages.Offset#formatOffset}. 105 */ 96 106 @Test 97 public void testFormatOff est() throws ParseException{107 public void testFormatOffset() { 98 108 assertEquals("0", CorrelateGpxWithImages.Offset.seconds(0).formatOffset()); 99 109 assertEquals("123", CorrelateGpxWithImages.Offset.seconds(123).formatOffset()); … … 106 116 } 107 117 118 /** 119 * Unit test of {@link CorrelateGpxWithImages.Offset#parseOffset}. 120 * @throws ParseException in case of parsing error 121 */ 108 122 @Test 109 123 public void testParseOffest() throws ParseException { … … 117 131 } 118 132 133 /** 134 * Unit test of {@link CorrelateGpxWithImages.Offset#splitOutTimezone}. 135 */ 119 136 @Test 120 public void testSplitOutTimezone() throws Exception{137 public void testSplitOutTimezone() { 121 138 assertEquals("+1:00", CorrelateGpxWithImages.Offset.seconds(3602).splitOutTimezone().a.formatTimezone()); 122 139 assertEquals("2", CorrelateGpxWithImages.Offset.seconds(3602).splitOutTimezone().b.formatOffset()); -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r8876 r9753 18 18 import org.openstreetmap.josm.gui.layer.ImageryLayer; 19 19 import org.openstreetmap.josm.gui.layer.Layer; 20 import org.openstreetmap.josm.gui.layer.NoteLayer; 20 21 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 22 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; … … 129 130 assertEquals(image.getDy(), -56.78, 1e-9); 130 131 } 132 133 /** 134 * Tests to read a .joz file containing notes. 135 * @throws IOException if any I/O error occurs 136 * @throws IllegalDataException is the test file is considered as invalid 137 */ 138 @Test 139 public void testReadNotes() throws IOException, IllegalDataException { 140 final List<Layer> layers = testRead("notes.joz"); 141 assertSame(layers.size(), 1); 142 assertTrue(layers.get(0) instanceof NoteLayer); 143 final NoteLayer layer = (NoteLayer) layers.get(0); 144 assertEquals("Notes", layer.getName()); 145 assertEquals(174, layer.getNoteData().getNotes().size()); 146 } 131 147 } -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
r9296 r9753 19 19 import org.openstreetmap.josm.data.gpx.WayPoint; 20 20 import org.openstreetmap.josm.data.imagery.ImageryInfo; 21 import org.openstreetmap.josm.data.notes.Note; 21 22 import org.openstreetmap.josm.data.osm.DataSet; 22 23 import org.openstreetmap.josm.gui.layer.GpxLayer; 23 24 import org.openstreetmap.josm.gui.layer.ImageryLayer; 24 25 import org.openstreetmap.josm.gui.layer.Layer; 26 import org.openstreetmap.josm.gui.layer.NoteLayer; 25 27 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 26 28 import org.openstreetmap.josm.gui.layer.TMSLayer; … … 139 141 } 140 142 143 private NoteLayer createNoteLayer() { 144 return new NoteLayer(Arrays.asList(new Note(LatLon.ZERO)), "layer name"); 145 } 146 141 147 /** 142 148 * Tests to write an empty .jos file. … … 204 210 testWrite(Collections.singletonList(layer), true); 205 211 } 212 213 /** 214 * Tests to write a .joz file containing a note layer. 215 */ 216 @Test 217 public void testWriteNoteLayer() { 218 final Layer layer = createNoteLayer(); 219 testWrite(Collections.singletonList(layer), true); 220 } 206 221 }
Note:
See TracChangeset
for help on using the changeset viewer.