Changeset 9400 in josm for trunk/test/unit
- Timestamp:
- 2016-01-11T01:02:56+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
r9334 r9400 14 14 import org.openstreetmap.josm.JOSMFixture; 15 15 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 16 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 17 import org.openstreetmap.josm.gui.mappaint.StyleKeys; 16 18 import org.openstreetmap.josm.gui.mappaint.StyleSource; 19 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction; 20 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.AssignmentInstruction; 21 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule; 22 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 17 23 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException; 18 24 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry; … … 48 54 System.out.println(source.url); 49 55 StyleSource style = MapPaintStyles.addStyle(source); 56 if (style instanceof MapCSSStyleSource) { 57 // Force loading of all icons to detect missing ones 58 for (MapCSSRule rule : ((MapCSSStyleSource) style).rules) { 59 for (Instruction instruction : rule.declaration.instructions) { 60 if (instruction instanceof AssignmentInstruction) { 61 AssignmentInstruction ai = (AssignmentInstruction) instruction; 62 if (StyleKeys.ICON_IMAGE.equals(ai.key) 63 || StyleKeys.FILL_IMAGE.equals(ai.key) 64 || StyleKeys.REPEAT_IMAGE.equals(ai.key)) { 65 if (ai.val instanceof String) { 66 MapPaintStyles.getIconProvider(new IconReference((String) ai.val, style), true); 67 } 68 } 69 } 70 } 71 } 72 } 50 73 System.out.println(style.isValid() ? " => OK" : " => KO"); 51 74 Collection<Throwable> errors = style.getErrors();
Note:
See TracChangeset
for help on using the changeset viewer.