Changeset 14528 in josm for trunk/test
- Timestamp:
- 2018-12-08T23:48:44+01:00 (6 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r14410 r14528 25 25 import java.util.Collection; 26 26 import java.util.Comparator; 27 import java.util.List; 27 28 import java.util.Objects; 28 29 import java.util.Set; 29 30 import java.util.concurrent.ExecutionException; 30 31 import java.util.concurrent.ThreadPoolExecutor; 32 import java.util.stream.Collectors; 31 33 import java.util.stream.Stream; 32 34 … … 52 54 import org.openstreetmap.josm.tools.JosmRuntimeException; 53 55 import org.openstreetmap.josm.tools.Utils; 56 import org.openstreetmap.josm.tools.WikiReader; 54 57 import org.reflections.Reflections; 55 58 … … 578 581 return Utils.getSystemProperty("osm.username") != null && Utils.getSystemProperty("osm.password") != null; 579 582 } 583 584 /** 585 * Returns the ignored error messages listed on 586 * <a href="https://josm.openstreetmap.de/wiki/IntegrationTestIgnores">JOSM wiki</a> for a given test. 587 * @param integrationTest The integration test class 588 * @return the ignored error messages listed on JOSM wiki for this test. 589 * @throws IOException in case of I/O error 590 */ 591 public static List<String> getIgnoredErrorMessages(Class<?> integrationTest) throws IOException { 592 return Arrays.stream(new WikiReader() 593 .read("https://josm.openstreetmap.de/wiki/IntegrationTestIgnores?format=txt") 594 .split("\\n")) 595 .filter(s -> s.startsWith("|| " + integrationTest.getSimpleName() + " ||")) 596 .map(s -> s.substring(s.indexOf("{{{") + 3, s.indexOf("}}}"))) 597 .collect(Collectors.toList()); 598 } 580 599 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
r14527 r14528 15 15 import java.util.concurrent.TimeUnit; 16 16 17 import org.junit.Before; 17 18 import org.junit.Rule; 18 19 import org.junit.Test; … … 24 25 import org.openstreetmap.gui.jmapviewer.tilesources.ScanexTileSource; 25 26 import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource; 27 import org.openstreetmap.josm.TestUtils; 26 28 import org.openstreetmap.josm.data.Bounds; 27 29 import org.openstreetmap.josm.data.coor.LatLon; … … 57 59 @Rule 58 60 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 59 public JOSMTestRules test = new JOSMTestRules().https().pr ojection().projectionNadGrids().timeout(10000*60);61 public JOSMTestRules test = new JOSMTestRules().https().preferences().projection().projectionNadGrids().timeout(10000*60); 60 62 61 63 private final Map<String, Map<ImageryInfo, List<String>>> errors = Collections.synchronizedMap(new TreeMap<>()); 62 64 private final Set<String> workingURLs = Collections.synchronizedSet(new HashSet<>()); 63 65 66 private List<String> ignoredErrors; 67 68 /** 69 * Setup test 70 * @throws IOException in case of I/O error 71 */ 72 @Before 73 public void before() throws IOException { 74 ignoredErrors = TestUtils.getIgnoredErrorMessages(ImageryPreferenceTestIT.class); 75 } 76 64 77 private boolean addError(ImageryInfo info, String error) { 65 return errors.computeIfAbsent(info.getCountryCode(), x -> Collections.synchronizedMap(new TreeMap<>())) 78 return !ignoredErrors.contains(error) && 79 errors.computeIfAbsent(info.getCountryCode(), x -> Collections.synchronizedMap(new TreeMap<>())) 66 80 .computeIfAbsent(info, x -> Collections.synchronizedList(new ArrayList<>())) 67 81 .add(error);
Note:
See TracChangeset
for help on using the changeset viewer.