Changeset 15459 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2019-10-16T17:23:02+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java
r14138 r15459 2 2 package org.openstreetmap.josm.data.validation; 3 3 4 import static org.junit.Assert.assertFalse; 5 import static org.junit.Assert.assertTrue; 6 7 import org.junit.Before; 4 8 import org.junit.Rule; 5 9 import org.junit.Test; … … 19 23 @Rule 20 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 21 public JOSMTestRules test = new JOSMTestRules() ;25 public JOSMTestRules test = new JOSMTestRules().projection(); 22 26 27 /** 28 * Setup test. 29 * @throws Exception if an error occurs 30 */ 31 @Before 32 public void setUp() throws Exception { 33 OsmValidator.clearIgnoredErrors(); 34 } 23 35 /** 24 36 * Tests that {@code OsmValidator} satisfies utility class criterias. … … 29 41 UtilityClassTestUtil.assertUtilityClassWellDefined(OsmValidator.class); 30 42 } 43 44 /** 45 * Test that {@link OsmValidator#cleanupIgnoredErrors()} really removes entry with element IDs when group is ignored 46 */ 47 @Test 48 public void testCleanupIgnoredErrors1() { 49 OsmValidator.addIgnoredError("1351:n_2449148994:w_236955234", "Way end node near other way"); 50 OsmValidator.addIgnoredError("1351:n_6871910559:w_733713588", "Way end node near other way"); 51 OsmValidator.addIgnoredError("1351"); 52 OsmValidator.cleanupIgnoredErrors(); 53 assertTrue(OsmValidator.hasIgnoredError("1351")); 54 assertFalse(OsmValidator.hasIgnoredError("1351:n_6871910559:w_733713588")); 55 assertFalse(OsmValidator.hasIgnoredError("1351:n_2449148994:w_236955234")); 56 } 57 58 /** 59 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17837">Bug #17837</a>. 60 * {@link OsmValidator#cleanupIgnoredErrors()} must not remove entry 1201 when 120 is before it. 61 */ 62 @Test 63 public void testCleanupIgnoredErrorsTicket17837() { 64 OsmValidator.addIgnoredError("120"); 65 OsmValidator.addIgnoredError("3000"); 66 OsmValidator.addIgnoredError("1201"); // starts with 120, but has different code 67 OsmValidator.cleanupIgnoredErrors(); 68 assertTrue(OsmValidator.hasIgnoredError("1201")); 69 } 70 71 /** 72 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18223">Bug #18223</a>. 73 * {@link OsmValidator#cleanupIgnoredErrors()} must not combine primitives. 74 */ 75 @Test 76 public void testCleanupIgnoredErrorsTicket18223() { 77 OsmValidator.addIgnoredError("1351:n_2449148994:w_236955234", "Way end node near other way"); 78 OsmValidator.addIgnoredError("1351:n_6871910559:w_733713588", "Way end node near other way"); 79 OsmValidator.cleanupIgnoredErrors(); 80 assertFalse(OsmValidator.hasIgnoredError("1351")); 81 assertTrue(OsmValidator.hasIgnoredError("1351:n_2449148994:w_236955234")); 82 assertTrue(OsmValidator.hasIgnoredError("1351:n_6871910559:w_733713588")); 83 } 84 31 85 }
Note:
See TracChangeset
for help on using the changeset viewer.