Changeset 18011 in josm for trunk/test
- Timestamp:
- 2021-07-13T22:49:09+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java
r17990 r18011 21 21 import java.util.ArrayList; 22 22 import java.util.Collection; 23 import java.util.List; 23 24 import java.util.Map; 24 25 import java.util.Objects; … … 127 128 MapCSSStyleSource styleSource2 = (MapCSSStyleSource) sources.get(source2).getStyleSources().get(0); 128 129 130 awaitSaveFinished(); 131 132 assertTrue(styleSource1.url.endsWith("source1.mapcss")); 133 assertTrue(styleSource2.url.endsWith("source2.mapcss")); 134 135 MapCSSStyleSource mapCSSStyleSource1 = new MapCSSStyleSource(styleSource1.url, styleSource1.name, styleSource1.title); 136 MapCSSStyleSource mapCSSStyleSource2 = new MapCSSStyleSource(styleSource2.url, styleSource2.name, styleSource2.title); 137 138 assertEquals(styleSource1, mapCSSStyleSource1); 139 assertEquals(styleSource2, mapCSSStyleSource2); 140 } 141 142 private static void awaitSaveFinished() { 129 143 AtomicBoolean saveFinished = new AtomicBoolean(); 130 144 MainApplication.worker.execute(() -> saveFinished.set(true)); 131 145 Awaitility.await().atMost(Durations.ONE_SECOND).until(saveFinished::get); 132 133 assertTrue(styleSource1.url.endsWith("source1.mapcss"));134 assertTrue(styleSource2.url.endsWith("source2.mapcss"));135 136 MapCSSStyleSource mapCSSStyleSource1 = new MapCSSStyleSource(styleSource1.url, styleSource1.name, styleSource1.title);137 MapCSSStyleSource mapCSSStyleSource2 = new MapCSSStyleSource(styleSource2.url, styleSource2.name, styleSource2.title);138 139 assertEquals(styleSource1, mapCSSStyleSource1);140 assertEquals(styleSource2, mapCSSStyleSource2);141 146 } 142 147 … … 165 170 assertEquals(spritePath, style.getSpriteUrl()); 166 171 167 AtomicBoolean saveFinished = new AtomicBoolean(); 168 MainApplication.worker.execute(() -> saveFinished.set(true)); 169 Awaitility.await().atMost(Durations.ONE_SECOND).until(saveFinished::get); 172 awaitSaveFinished(); 170 173 171 174 int scalar = 28; // 255 / 9 (could be 4, but this was a nicer number) … … 246 249 assertNotNull(mapillarySource, style.toString()); 247 250 mapillarySource.getStyleSources().forEach(StyleSource::loadStyleSource); 248 assertEquals(1, mapillarySource.getStyleSources().size()); 249 final MapCSSStyleSource mapillaryCssSource = (MapCSSStyleSource) mapillarySource.getStyleSources().get(0); 251 List<StyleSource> styleSources = mapillarySource.getStyleSources(); 252 assertEquals(1, styleSources.size()); 253 final MapCSSStyleSource mapillaryCssSource = (MapCSSStyleSource) styleSources.get(0); 254 255 awaitSaveFinished(); 256 250 257 assertTrue(mapillaryCssSource.getErrors().isEmpty(), mapillaryCssSource.getErrors().toString()); 251 258 final MapCSSRule mapillaryOverview = getRule(mapillaryCssSource, "node", "mapillary-overview");
Note:
See TracChangeset
for help on using the changeset viewer.