1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.validation.tests;
|
---|
3 |
|
---|
4 | import static org.CustomMatchers.isEmpty;
|
---|
5 | import static org.junit.Assert.assertThat;
|
---|
6 |
|
---|
7 | import java.io.InputStream;
|
---|
8 |
|
---|
9 | import org.junit.Before;
|
---|
10 | import org.junit.Test;
|
---|
11 | import org.openstreetmap.josm.JOSMFixture;
|
---|
12 | import org.openstreetmap.josm.TestUtils;
|
---|
13 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
14 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
|
---|
15 | import org.openstreetmap.josm.io.OsmReader;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Unit tests of {@code UntaggedNode} class.
|
---|
19 | */
|
---|
20 | public class UntaggedNodeTest {
|
---|
21 |
|
---|
22 | private UntaggedNode test;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * Setup test.
|
---|
26 | */
|
---|
27 | @Before
|
---|
28 | public void setUp() {
|
---|
29 | JOSMFixture.createUnitTestFixture().init();
|
---|
30 | test = new UntaggedNode();
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12436">Bug #12436</a>.
|
---|
35 | * @throws Exception if an error occurs
|
---|
36 | */
|
---|
37 | @Test
|
---|
38 | public void testTicket12436() throws Exception {
|
---|
39 | test.initialize();
|
---|
40 | test.startTest(null);
|
---|
41 | try (InputStream fis = TestUtils.getRegressionDataStream(12436, "example.osm")) {
|
---|
42 | final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
|
---|
43 | test.visit(ds.allPrimitives());
|
---|
44 | test.endTest();
|
---|
45 | assertThat(test.getErrors(), isEmpty());
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|