diff --git a/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MVTTileTest.java b/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MVTTileTest.java
index 67f0a3783..5d60c9e22 100644
|
a
|
b
|
import java.util.stream.Stream;
|
| 10 | 10 | |
| 11 | 11 | import org.awaitility.Awaitility; |
| 12 | 12 | import org.awaitility.Durations; |
| 13 | | import org.junit.jupiter.api.BeforeEach; |
| 14 | 13 | import org.junit.jupiter.params.ParameterizedTest; |
| 15 | 14 | import org.junit.jupiter.params.provider.Arguments; |
| 16 | 15 | import org.junit.jupiter.params.provider.MethodSource; |
| … |
… |
import org.openstreetmap.josm.data.imagery.TileJobOptions;
|
| 25 | 24 | * Test class for {@link MVTTile} |
| 26 | 25 | */ |
| 27 | 26 | class MVTTileTest { |
| 28 | | private MapboxVectorTileSource tileSource; |
| 29 | | private MapboxVectorCachedTileLoader loader; |
| 30 | | @BeforeEach |
| 31 | | void setup() { |
| 32 | | tileSource = new MapboxVectorTileSource(new ImageryInfo("Test Mapillary", "file:/" + TestUtils.getTestDataRoot() |
| 33 | | + "pbf/mapillary/{z}/{x}/{y}.mvt")); |
| 34 | | loader = new MapboxVectorCachedTileLoader(null, |
| 35 | | JCSCacheManager.getCache("testMapillaryCache"), new TileJobOptions(1, 1, Collections |
| 36 | | .emptyMap(), 3600)); |
| 37 | | } |
| | 27 | private MapboxVectorCachedTileLoader loader = new MapboxVectorCachedTileLoader( |
| | 28 | null, JCSCacheManager.getCache("testMapillaryCache"), new TileJobOptions(1, 1, Collections.emptyMap(), 3600)); |
| | 29 | private MapboxVectorTileSource tileSource = new MapboxVectorTileSource( |
| | 30 | new ImageryInfo("Test Mapillary", "file:/" + TestUtils.getTestDataRoot() + "pbf/mapillary/{z}/{x}/{y}.mvt")); |
| 38 | 31 | |
| 39 | 32 | /** |
| 40 | 33 | * Provide arguments for {@link #testMVTTile(BufferedImage, Boolean)} |
| … |
… |
class MVTTileTest {
|
| 57 | 50 | assertEquals(image, tile.getImage()); |
| 58 | 51 | |
| 59 | 52 | TileJob job = loader.createTileLoaderJob(tile); |
| 60 | | job.submit(); |
| | 53 | // we can't use the cache, because we request the same tile many times over |
| | 54 | job.submit(true); |
| 61 | 55 | Awaitility.await().atMost(Durations.ONE_SECOND).until(tile::isLoaded); |
| 62 | 56 | if (isLoaded) { |
| 63 | | Awaitility.await().atMost(Durations.ONE_SECOND).until(() -> tile.getLayers() != null && tile.getLayers().size() > 1); |
| | 57 | Awaitility.await().atMost(Durations.ONE_SECOND).until(() -> tile.getImage() == MVTTile.CLEAR_LOADED); |
| 64 | 58 | assertEquals(2, tile.getLayers().size()); |
| 65 | 59 | assertEquals(4096, tile.getExtent()); |
| 66 | 60 | // Ensure that we have the clear image set, such that the tile doesn't add to the dataset again |