1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.validation.tests;
|
---|
3 |
|
---|
4 | import static org.CustomMatchers.hasSize;
|
---|
5 | import static org.CustomMatchers.isEmpty;
|
---|
6 | import static org.junit.Assert.assertThat;
|
---|
7 |
|
---|
8 | import java.io.InputStream;
|
---|
9 |
|
---|
10 | import org.junit.Rule;
|
---|
11 | import org.junit.Test;
|
---|
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 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
17 |
|
---|
18 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Unit tests of {@code UntaggedNode} class.
|
---|
22 | */
|
---|
23 | public class UntaggedNodeTest {
|
---|
24 |
|
---|
25 | private final UntaggedNode test = new UntaggedNode();
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * Setup test.
|
---|
29 | */
|
---|
30 | @Rule
|
---|
31 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
32 | public JOSMTestRules rules = new JOSMTestRules();
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12436">Bug #12436</a>.
|
---|
36 | * @throws Exception if an error occurs
|
---|
37 | */
|
---|
38 | @Test
|
---|
39 | public void testTicket12436() throws Exception {
|
---|
40 | test.initialize();
|
---|
41 | test.startTest(null);
|
---|
42 | try (InputStream fis = TestUtils.getRegressionDataStream(12436, "example.osm")) {
|
---|
43 | final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
|
---|
44 | test.visit(ds.allPrimitives());
|
---|
45 | test.endTest();
|
---|
46 | assertThat(test.getErrors(), isEmpty());
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12464">Bug #12464</a>.
|
---|
52 | * @throws Exception if an error occurs
|
---|
53 | */
|
---|
54 | @Test
|
---|
55 | public void testTicket12464() throws Exception {
|
---|
56 | test.initialize();
|
---|
57 | test.startTest(null);
|
---|
58 | try (InputStream fis = TestUtils.getRegressionDataStream(12464, "example.osm")) {
|
---|
59 | final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
|
---|
60 | test.visit(ds.allPrimitives());
|
---|
61 | test.endTest();
|
---|
62 | assertThat(test.getErrors(), hasSize(1));
|
---|
63 | }
|
---|
64 | }
|
---|
65 | }
|
---|