Changeset 16360 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r16273 r16360 538 538 * 539 539 * @param p the primitive to construct the error for 540 * @param matchingSelector the matching selector (e.g., obtained via {@link #whichSelectorMatchesPrimitive}) 541 * @param env the environment 542 * @param tester the tester 540 543 * @return an instance of {@link TestError}, or returns null if the primitive does not give rise to an error. 541 544 */ 542 List<TestError> getErrorsForPrimitive(OsmPrimitive p) { 543 final Environment env = new Environment(p); 544 return getErrorsForPrimitive(p, whichSelectorMatchesEnvironment(env), env, null); 545 } 546 547 private List<TestError> getErrorsForPrimitive(OsmPrimitive p, Selector matchingSelector, Environment env, Test tester) { 545 protected List<TestError> getErrorsForPrimitive(OsmPrimitive p, Selector matchingSelector, Environment env, Test tester) { 548 546 List<TestError> res = new ArrayList<>(); 549 547 if (matchingSelector != null && !errors.isEmpty()) { -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
r16356 r16360 38 38 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.ParseResult; 39 39 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.TagCheck; 40 import org.openstreetmap.josm.gui.mappaint.Environment; 40 41 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 41 42 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; … … 103 104 assertTrue(check.test(n1)); 104 105 105 final Collection<TestError> errors = check.getErrorsForPrimitive(n1 );106 final Collection<TestError> errors = check.getErrorsForPrimitive(n1, check.whichSelectorMatchesPrimitive(n1), new Environment(), null); 106 107 assertEquals(1, errors.size()); 107 108 TestError err = errors.iterator().next();
Note:
See TracChangeset
for help on using the changeset viewer.