Changeset 17384 in josm for trunk/test/unit/org
- Timestamp:
- 2020-12-02T08:30:13+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConnectivityRelationsTest.java
r17275 r17384 5 5 import org.junit.jupiter.api.BeforeEach; 6 6 import org.junit.jupiter.api.Test; 7 import org. openstreetmap.josm.JOSMFixture;7 import org.junit.jupiter.api.extension.RegisterExtension; 8 8 import org.openstreetmap.josm.TestUtils; 9 9 import org.openstreetmap.josm.data.coor.LatLon; … … 11 11 import org.openstreetmap.josm.data.osm.Relation; 12 12 import org.openstreetmap.josm.data.osm.RelationMember; 13 import org.openstreetmap.josm.testutils.JOSMTestRules; 14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 13 16 14 17 /** … … 20 23 private ConnectivityRelations check; 21 24 private static final String CONNECTIVITY = "connectivity"; 25 22 26 /** 23 27 * Setup test. 24 *25 * @throws Exception if an error occurs26 28 */ 29 @RegisterExtension 30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 public JOSMTestRules rule = new JOSMTestRules(); 32 27 33 @BeforeEach 28 public void setUp() throws Exception { 29 JOSMFixture.createUnitTestFixture().init(); 34 public void setUpCheck() throws Exception { 30 35 check = new ConnectivityRelations(); 31 36 } … … 86 91 } 87 92 93 /** 94 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/201821">Bug #20182</a>. 95 * @throws Exception if an error occurs 96 */ 97 @Test 98 void testTicket20182() throws Exception { 99 Relation relation = createDefaultTestRelation(); 100 check.visit(relation); 101 int expectedFailures = 0; 102 103 Assert.assertEquals(expectedFailures, check.getErrors().size()); 104 105 relation.put(CONNECTIVITY, "left_turn"); 106 check.visit(relation); 107 Assert.assertEquals(++expectedFailures, check.getErrors().size()); 108 109 relation.put(CONNECTIVITY, "1"); 110 check.visit(relation); 111 Assert.assertEquals(++expectedFailures, check.getErrors().size()); 112 } 88 113 }
Note:
See TracChangeset
for help on using the changeset viewer.