Changeset 17619 in josm for trunk/test
- Timestamp:
- 2021-03-21T13:56:21+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
r17275 r17619 37 37 import org.openstreetmap.josm.data.validation.TestError; 38 38 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.ParseResult; 39 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.TagCheck;40 39 import org.openstreetmap.josm.gui.mappaint.Environment; 41 40 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; … … 71 70 final MapCSSTagChecker test = new MapCSSTagChecker(); 72 71 Set<String> errors = new HashSet<>(); 73 test.checks.putAll("test", TagCheck.readMapCSS(new StringReader(css), errors::add).parseChecks);72 test.checks.putAll("test", MapCSSTagCheckerRule.readMapCSS(new StringReader(css), errors::add).parseChecks); 74 73 assertTrue(errors.isEmpty(), errors::toString); 75 74 return test; … … 82 81 @Test 83 82 void testNaturalMarsh() throws ParseException { 84 ParseResult result = TagCheck.readMapCSS(new StringReader(83 ParseResult result = MapCSSTagCheckerRule.readMapCSS(new StringReader( 85 84 "*[natural=marsh] {\n" + 86 85 " group: tr(\"deprecated\");\n" + … … 90 89 " fixAdd: \"wetland=marsh\";\n" + 91 90 "}")); 92 final List< TagCheck> checks = result.parseChecks;91 final List<MapCSSTagCheckerRule> checks = result.parseChecks; 93 92 assertEquals(1, checks.size()); 94 93 assertTrue(result.parseErrors.isEmpty()); 95 final TagCheckcheck = checks.get(0);94 final MapCSSTagCheckerRule check = checks.get(0); 96 95 assertNotNull(check); 97 96 assertEquals("{0.key}=null is deprecated", check.getDescription(null)); … … 114 113 assertFalse(check.test(n2)); 115 114 assertEquals("The key is natural and the value is marsh", 116 TagCheck.insertArguments(check.rule.selectors.get(0), "The key is {0.key} and the value is {0.value}", null));115 MapCSSTagCheckerRule.insertArguments(check.rule.selectors.get(0), "The key is {0.key} and the value is {0.value}", null)); 117 116 } 118 117 … … 124 123 void testTicket10913() throws ParseException { 125 124 final OsmPrimitive p = TestUtils.addFakeDataSet(TestUtils.newWay("highway=tertiary construction=yes")); 126 final TagCheckcheck =TagCheck.readMapCSS(new StringReader("way {" +125 final MapCSSTagCheckerRule check = MapCSSTagCheckerRule.readMapCSS(new StringReader("way {" + 127 126 "throwError: \"error\";" + 128 127 "fixChangeKey: \"highway => construction\";\n" + … … 172 171 @Test 173 172 void testTicket13630() throws ParseException { 174 ParseResult result = TagCheck.readMapCSS(new StringReader(173 ParseResult result = MapCSSTagCheckerRule.readMapCSS(new StringReader( 175 174 "node[crossing=zebra] {fixRemove: \"crossing=zebra\";}")); 176 175 assertTrue(result.parseChecks.isEmpty()); … … 265 264 @Test 266 265 void testTicket13762() throws ParseException { 267 final ParseResult parseResult = TagCheck.readMapCSS(new StringReader("" +266 final ParseResult parseResult = MapCSSTagCheckerRule.readMapCSS(new StringReader("" + 268 267 "meta[lang=de] {\n" + 269 268 " title: \"Deutschlandspezifische Regeln\";" + … … 302 301 "}"); 303 302 assertEquals(1, test.checks.size()); 304 TagCheckcheck = test.checks.get("test").iterator().next();303 MapCSSTagCheckerRule check = test.checks.get("test").iterator().next(); 305 304 assertEquals(1, check.fixCommands.size()); 306 305 assertEquals(2, check.rule.declaration.instructions.size());
Note:
See TracChangeset
for help on using the changeset viewer.