source: josm/trunk/test/unit/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrectorTest.java@ 10956

Last change on this file since 10956 was 10945, checked in by Don-vip, 8 years ago

convert more unit tests to JOSMTestRules

File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.corrector;
3
4import static org.junit.Assert.assertEquals;
5
6import org.junit.Rule;
7import org.junit.Test;
8import org.openstreetmap.josm.data.osm.Tag;
9import org.openstreetmap.josm.testutils.JOSMTestRules;
10
11import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
12
13/**
14 * Unit tests of {@link ReverseWayNoTagCorrector} class.
15 */
16public class ReverseWayNoTagCorrectorTest {
17
18 /**
19 * Setup test.
20 */
21 @Rule
22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
23 public JOSMTestRules test = new JOSMTestRules();
24
25 /**
26 * Tests the {@link ReverseWayNoTagCorrector#getDirectionalTags} function
27 */
28 @Test
29 public void testDirectionalTags() {
30 assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("waterway", "drain")).size());
31 assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("man_made", "embankment")).size());
32 assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("aerialway", "cable_car")).size());
33 assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("aerialway", "station")).size());
34 assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("incline", "up")).size());
35 assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("oneway", "yes")).size());
36 }
37}
Note: See TracBrowser for help on using the repository browser.