Changeset 9334 in josm for trunk/test/unit
- Timestamp:
- 2016-01-07T01:53:58+01:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageEntryTest.java
r9329 r9334 5 5 6 6 import java.io.File; 7 import java.io.IOException;8 7 9 8 import org.junit.Test; 10 9 import org.openstreetmap.josm.TestUtils; 11 import org.openstreetmap.josm.io.IllegalDataException;12 import org.xml.sax.SAXException;13 10 14 11 /** … … 19 16 /** 20 17 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12255">#12255</a>. 21 * @throws IllegalDataException if an error was found while parsing the data from the source22 * @throws IOException if any I/O error occurs23 * @throws SAXException if any XML error occurs24 18 */ 25 19 @Test 26 public void testTicket12255() throws IllegalDataException, IOException, SAXException{20 public void testTicket12255() { 27 21 ImageEntry e = new ImageEntry(new File(TestUtils.getRegressionDataFile(12255, "G0016941.JPG"))); 28 22 e.extractExif(); -
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.