source: josm/trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java@ 11974

Last change on this file since 11974 was 11435, checked in by Don-vip, 7 years ago

fix #14199 - JOSM drops empty tags on loading and thus prevents correcting them

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io;
3
4import static org.junit.Assert.assertEquals;
5import static org.junit.Assert.assertNull;
6import static org.junit.Assert.assertTrue;
7
8import java.io.InputStream;
9
10import org.junit.Test;
11import org.openstreetmap.josm.TestUtils;
12import org.openstreetmap.josm.data.osm.Way;
13import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
14
15/**
16 * Unit tests of {@link OsmReader} class.
17 */
18public class OsmReaderTest {
19
20 /**
21 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/14199">Bug #14199</a>.
22 * @throws Exception if any error occurs
23 */
24 @Test
25 public void testTicket14199() throws Exception {
26 try (InputStream in = TestUtils.getRegressionDataStream(14199, "emptytag.osm")) {
27 Way w = OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE).getWays().iterator().next();
28 assertEquals(1, w.getKeys().size());
29 assertNull(w.get(" "));
30 assertTrue(w.isModified());
31 }
32 }
33}
Note: See TracBrowser for help on using the repository browser.