1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.validation.util;
|
---|
3 |
|
---|
4 | import static org.junit.Assert.assertEquals;
|
---|
5 |
|
---|
6 | import java.util.Arrays;
|
---|
7 |
|
---|
8 | import org.junit.Rule;
|
---|
9 | import org.junit.Test;
|
---|
10 | import org.openstreetmap.josm.TestUtils;
|
---|
11 | import org.openstreetmap.josm.data.osm.Way;
|
---|
12 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
13 |
|
---|
14 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Unit tests for class {@link MultipleNameVisitor}.
|
---|
18 | */
|
---|
19 | public class MultipleNameVisitorTest {
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Setup test.
|
---|
23 | */
|
---|
24 | @Rule
|
---|
25 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
26 | public JOSMTestRules test = new JOSMTestRules().preferences();
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Non-regression test for bug #11967.
|
---|
30 | */
|
---|
31 | @Test
|
---|
32 | public void testTicket11967() {
|
---|
33 | MultipleNameVisitor visitor = new MultipleNameVisitor();
|
---|
34 | visitor.visit(Arrays.asList(new Way(), new Way()));
|
---|
35 | assertEquals("2 ways: 0 (0 nodes), 0 (0 nodes)", visitor.toString());
|
---|
36 | }
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Non-regression test for bug #16652.
|
---|
40 | */
|
---|
41 | @Test
|
---|
42 | public void testTicket16652() {
|
---|
43 | MultipleNameVisitor visitor = new MultipleNameVisitor();
|
---|
44 | visitor.visit(Arrays.asList(
|
---|
45 | TestUtils.newNode("name=foo"),
|
---|
46 | TestUtils.newWay("addr:housename=Stark"),
|
---|
47 | TestUtils.newRelation("type=route")));
|
---|
48 | assertEquals("3 objects: foo, House Stark (0 nodes), route (0, 0 members)", visitor.toString());
|
---|
49 | }
|
---|
50 | }
|
---|