Changeset 14990 in josm for trunk/test
- Timestamp:
- 2019-04-14T17:29:33+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java
r14969 r14990 8 8 import java.util.List; 9 9 10 import org.junit. Before;10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 12 import org.openstreetmap.josm.data.osm.Relation; 14 13 import org.openstreetmap.josm.data.osm.RelationMember; 15 14 import org.openstreetmap.josm.data.osm.Way; 16 15 import org.openstreetmap.josm.data.validation.TestError; 17 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 16 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 19 19 20 /** … … 21 22 */ 22 23 public class RelationCheckerTest { 23 24 24 /** 25 25 * Setup test. 26 26 */ 27 @Before 28 public void setUp() { 29 JOSMFixture.createUnitTestFixture().init(); 30 getRelationChecker(); 31 } 27 @Rule 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules rule = new JOSMTestRules().presets(); 32 30 33 31 private static RelationChecker getRelationChecker() { 34 32 RelationChecker checker = new RelationChecker(); 35 TaggingPresets.readFromPreferences();36 33 checker.initialize(); 37 34 return checker; … … 104 101 List<TestError> errors = testRelation(r); 105 102 assertEquals(1, errors.size()); 106 assertEquals("Type 'relation' of relation member with role 'via' does not match accepted types 'node/way' in templateTurn Restriction",103 assertEquals("Type 'relation' of relation member with role 'via' does not match accepted types 'node/way' in preset Turn Restriction", 107 104 errors.get(0).getDescription()); 108 105 } … … 131 128 List<TestError> errors = testRelation(r); 132 129 assertEquals(1, errors.size()); 133 assertTrue(errors.get(0).getDescription().startsWith("Empty role typefound when expecting one of"));130 assertTrue(errors.get(0).getDescription().startsWith("Empty role found when expecting one of")); 134 131 } 135 132 … … 141 138 List<TestError> errors = testRelation(r); 142 139 assertEquals(1, errors.size()); 143 assertEquals("Role of relation member does not match expression 'power' in templatePower Route", errors.get(0).getDescription());140 assertEquals("Role of relation member does not match template expression 'power' in preset Power Route", errors.get(0).getDescription()); 144 141 } 145 142 … … 169 166 r.addMember(new RelationMember("", createPrimitive("way no-rail-way=yes"))); 170 167 assertEquals(1, testRelation(r).size()); 171 assertEquals("Role of relation member does not match expression 'railway' in templatePublic Transport Route (Rail)",168 assertEquals("Role of relation member does not match template expression 'railway' in preset Public Transport Route (Rail)", 172 169 testRelation(r).get(0).getDescription()); 173 170 … … 176 173 assertEquals(1, testRelation(r).size()); 177 174 assertEquals( 178 "Type 'way' of relation member with role 'stop' does not match accepted types 'node' in templatePublic Transport Route (Rail)",175 "Type 'way' of relation member with role 'stop' does not match accepted types 'node' in preset Public Transport Route (Rail)", 179 176 testRelation(r).get(0).getDescription()); 180 177 … … 182 179 r.addMember(new RelationMember("stop", createPrimitive("node public_transport=stop_position bus=yes"))); 183 180 assertEquals(1, testRelation(r).size()); 184 assertEquals("Role of relation member does not match expression 'public_transport=stop_position && "+ 185 "(train=yes || subway=yes || monorail=yes || tram=yes || light_rail=yes)' in templatePublic Transport Route (Rail)",181 assertEquals("Role of relation member does not match template expression 'public_transport=stop_position && "+ 182 "(train=yes || subway=yes || monorail=yes || tram=yes || light_rail=yes)' in preset Public Transport Route (Rail)", 186 183 testRelation(r).get(0).getDescription()); 187 184 }
Note:
See TracChangeset
for help on using the changeset viewer.