Changeset 9334 in josm for trunk/test/unit/org/openstreetmap/josm/gui/preferences
- Timestamp:
- 2016-01-07T01:53:58+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
r9166 r9334 14 14 import org.openstreetmap.josm.JOSMFixture; 15 15 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 16 import org.openstreetmap.josm.gui.mappaint.StyleSource; 16 17 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException; 17 18 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry; … … 41 42 assertFalse(sources.isEmpty()); 42 43 Map<String, Collection<Throwable>> allErrors = new HashMap<>(); 44 Map<String, Collection<String>> allWarnings = new HashMap<>(); 43 45 for (ExtendedSourceEntry source : sources) { 44 System.out.println(source.url); 45 Collection<Throwable> errors = MapPaintStyles.addStyle(source); 46 System.out.println(errors.isEmpty() ? " => OK" : " => KO"); 47 if (!errors.isEmpty()) { 48 allErrors.put(source.url, errors); 46 // Do not validate XML styles 47 if (!"xml".equalsIgnoreCase(source.styleType)) { 48 System.out.println(source.url); 49 StyleSource style = MapPaintStyles.addStyle(source); 50 System.out.println(style.isValid() ? " => OK" : " => KO"); 51 Collection<Throwable> errors = style.getErrors(); 52 Collection<String> warnings = style.getWarnings(); 53 if (!errors.isEmpty()) { 54 allErrors.put(source.url, errors); 55 } 56 if (!warnings.isEmpty()) { 57 allWarnings.put(source.url, warnings); 58 } 49 59 } 50 60 } 51 assertTrue(allErrors.toString() , allErrors.isEmpty());61 assertTrue(allErrors.toString()+"\n"+allWarnings.toString(), allErrors.isEmpty() && allWarnings.isEmpty()); 52 62 } 53 63 }
Note:
See TracChangeset
for help on using the changeset viewer.